Find Jobs
Hire Freelancers

C Homework! ( POker)

$25-30 USD

Cerrado
Publicado hace alrededor de 22 años

$25-30 USD

Pagado a la entrega
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 2, 3, 4, 5,6 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 [login to view URL] IN .c instead of .cpp There are 2 parts of the assgnment,hence need two separate code( one for the upper question and one for extra credit).The upper question is asking only to read from a file and (sort it) and then cheking and commenting whether it's royal flush,etc... Examples of characters:J Spades, K Hearts,etc. 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 ## Deadline information EVEN THOUGH THE DEADLINE IS 4/16/2002..I NEED THE CODE BY the 15th or ASAP...THE web doesnt allow me to put 4/15 for some reason
ID del proyecto: 2846477

Información sobre el proyecto

12 propuestas
Proyecto remoto
Activo hace 22 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
12 freelancers están ofertando un promedio de $17 USD por este trabajo
Avatar del usuario
See private message.
$8,50 USD en 14 días
4,9 (211 comentarios)
5,8
5,8
Avatar del usuario
See private message.
$17 USD en 14 días
5,0 (34 comentarios)
5,0
5,0
Avatar del usuario
See private message.
$25,50 USD en 14 días
4,6 (60 comentarios)
4,5
4,5
Avatar del usuario
See private message.
$25,50 USD en 14 días
5,0 (26 comentarios)
3,8
3,8
Avatar del usuario
See private message.
$17 USD en 14 días
5,0 (8 comentarios)
3,4
3,4
Avatar del usuario
See private message.
$25,50 USD en 14 días
5,0 (12 comentarios)
3,2
3,2
Avatar del usuario
See private message.
$14,45 USD en 14 días
5,0 (1 comentario)
1,9
1,9
Avatar del usuario
See private message.
$25,50 USD en 14 días
4,8 (5 comentarios)
1,3
1,3
Avatar del usuario
See private message.
$14,45 USD en 14 días
5,0 (2 comentarios)
1,0
1,0
Avatar del usuario
See private message.
$8,50 USD en 14 días
0,0 (1 comentario)
0,0
0,0
Avatar del usuario
See private message.
$17 USD en 14 días
0,0 (1 comentario)
0,0
0,0
Avatar del usuario
See private message.
$4,25 USD en 14 días
0,0 (1 comentario)
0,0
0,0

Sobre este cliente

Bandera de UNITED STATES
United States
5,0
1
Miembro desde mar 27, 2002

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.