Find Jobs
Hire Freelancers

C++ Home Work Assignment Help

$25-30 USD

已完成
已发布大约 22 年前

$25-30 USD

货到付款
A program that evaluates a single poker hand. Display the hand and print out what type it is. The ranks of hands are listed below from highest ranking to lowest ranking. Use a structure for the card, and an array of structures for the hand. Write a function for each type of hand, returning 1 if the hand fits that criterion, and 0 if it doesn't. The structure you will use should look something like the following: struct card { char suit; /* 'C', 'D', 'H', 'S' - for clubs, diamonds, hearts, and spades*/ int value; /* 2?10, Jack, Queen, King,Ace- 2-14 */ }; struct card hand[5]; To test this program create 10 files, one for each ranking hand, and read a single file into the program, but allow more than one file to be tested at any single run of the program. That means you must have a character array for the filename, so that the user may enter different file names within a loop structure. When you display the hand, you should obviously print out the cards more meaningfully. For instance, C 5 would be the 5 of clubs, S 11 would be the Jack of Spades. Royal Flush: A, K, Q, J, 10 all of the same suit. Straight Flush: Any five card sequence in the same suit. (Ex: 7, 8, 9, 10, J and A, 2, 3, 4, 5 of same suit). Four of a Kind: All four cards of the same value (Ex: J, J, J, J). Full House: Three of a kind combined with a pair (Ex: K, K, K, 10, 10). Flush: Any five cards of the same suit, but not in sequence. Straight: Five cards in sequence, but not in the same suit. Three of a Kind: Three cards of the same value (Ex. J,J,J). Two Pair: Two separate pairs (Ex: A, A, 8, 8). Pair: Two cards of the same value. High Card For extra credit Modify the program you wrote above in a second program to deal out four hands. Declare a struct card deck[52] to represent the whole deck. Initialize the deck with all the cards, perhaps in a file to read needing no user input, and using srand( ) and rand( ) deal out the four hands, evaluating each hand. Then to deal out four poker hands use random numbers from 0 to 51 for the index values of the array deck. Make sure that you don't deal out duplicate cards - you may need another field in the structure to accomplish that. ## Deliverables Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. Complete copyrights to all work purchased. ## Platform Platform to be used is Microsoft Visual C++ 6.0. Prgram should be running in it error & warning free.
项目 ID: 2846028

关于此项目

20提案
远程项目
活跃22 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
颁发给:
用户头像
See private message.
$12 USD 在14天之内
4.3 (2条评论)
0.8
0.8
20威客以平均价$20 USD来参与此工作竞价
用户头像
See private message.
$8.50 USD 在14天之内
4.9 (210条评论)
5.8
5.8
用户头像
See private message.
$25.50 USD 在14天之内
4.9 (139条评论)
5.6
5.6
用户头像
See private message.
$17 USD 在14天之内
5.0 (40条评论)
5.4
5.4
用户头像
See private message.
$21.25 USD 在14天之内
5.0 (53条评论)
5.4
5.4
用户头像
See private message.
$25.50 USD 在14天之内
5.0 (26条评论)
5.3
5.3
用户头像
See private message.
$17 USD 在14天之内
5.0 (35条评论)
5.0
5.0
用户头像
See private message.
$25.50 USD 在14天之内
5.0 (43条评论)
4.8
4.8
用户头像
See private message.
$25.50 USD 在14天之内
4.6 (59条评论)
4.4
4.4
用户头像
See private message.
$10.20 USD 在14天之内
5.0 (34条评论)
4.2
4.2
用户头像
See private message.
$25.50 USD 在14天之内
5.0 (12条评论)
3.2
3.2
用户头像
See private message.
$25.50 USD 在14天之内
3.5 (2条评论)
2.2
2.2
用户头像
See private message.
$15.30 USD 在14天之内
5.0 (11条评论)
1.7
1.7
用户头像
See private message.
$25.50 USD 在14天之内
4.4 (6条评论)
1.6
1.6
用户头像
See private message.
$25.50 USD 在14天之内
4.9 (6条评论)
1.5
1.5
用户头像
See private message.
$10.20 USD 在14天之内
4.0 (4条评论)
0.9
0.9
用户头像
See private message.
$25.50 USD 在14天之内
4.0 (1条评论)
0.0
0.0
用户头像
See private message.
$21.25 USD 在14天之内
0.0 (1条评论)
0.0
0.0
用户头像
See private message.
$25.50 USD 在14天之内
0.0 (0条评论)
3.1
3.1
用户头像
See private message.
$5.40 USD 在14天之内
0.0 (0条评论)
0.0
0.0

关于客户

PAKISTAN的国旗
Pakistan
0.7
2
会员自3月 27, 2002起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。