c++ card game homework

using eclipse and mingw

Contract Bridge is a card game where players must bid how many tricks they will win at the start of the play. To

do this, players evaluate their hands and assign a “point value” to the hand.

For this assignment you will read in a representation of a bridge hand, evaluate the point value, and print out how

many points are in the hand.

A bridge hand is made up of 13 cards. Each card has a face value, represented as one of the character sequences

A,2,3,4,5,6,7,8,9,10,J,Q,K; and a suit, represented by one of the characters C D H S. So, for example, the nine of

clubs is represented as 9C.

The input to the program will be strings representing cards. Each card is a face value separated from the other by a

comma, spaces or newlines. When the input contains a single line containing nothing but a dot character, this

indicates that the input of this hand is complete.

Once you read a hand in, you must apply the following rules to calculate the point value for the hand:

 Each Ace (A) is worth 4 points

 Each King (K) is worth 3 points

 Each Queen (Q) is worth 2 points

 Each Jack (J) is worth 1 point

 If the hand contains no aces, subtract 1 point

 If the hand contains four aces, add 1 point

 If the hand contains only one king, queen or jack, subtract 1 point

 For each suit with more than 4 cards in it, add 1 point for each card past 4 cards

 For each suit with zero cards in it, add 3 points

 For each suit with one card in it, add 2 points

 For each suit with two cards in it, add 1 point

When you calculate the resulting points, you should print out, on a line by itself:


Where x is an integer indicating the hand that was read in (the first hand is 1, the second is 2, etc.), and y is the

points that you calculated for the hand.

Your program will read the standard input for a hand. When the input of the hand is complete, your program

should validate that the hand is correct, calculate the points, print the result, and read the standard input for the next


A hand is correct if and only if it has 13 correctly formatted unique cards in it. If any of the cards is incorrectly

formatted, the program should print BAD FORMAT. If the count of cards is wrong, the program should print

WRONG NUMBER OF CARDS. If there are duplicate cards in the hand, the program should print DUPLICATE

CARDS. In these error cases, the program should continue reading the standard input for the next hand after it

prints the error message.

Your program should terminate on end-of-file.

Habilidades: Programación en C++, Arquitectura de software

Ver más: strings for c standard, standard contract example, eclipse architecture, do your homework for you, do homework for you, continue line in c, big flash game card, design game card layout, game card design layout, card game card layout, memory flash game card concentration, cool game card disign, game card designs, game card designer, game card design

Información del empleador:
( 1 comentario ) Newark, United States

Nº del proyecto: #9610602

Adjudicado a:


Hello. It is easy assignment and it can be completed in few hours of pure working time .................

$16 USD en 1 día
(1042 comentarios)

7 freelancers están ofertando el promedio de $39 para este trabajo

$60 USD en 1 día
(46 comentarios)

I can solve your problem within 1 day. Quickly and well. I have a lot of experience with C++ and algorithms. I have recently graduated from the second-best IT university in Europe (University of Warsaw).

$30 USD en 1 día
(8 comentarios)

Hello, client i have rich experience in C/C++/C# programming. I have rich knowledge about algorithm and data structure. Thanks Best regards

$54 USD en 1 día
(1 comentario)

Hello. How are u. I saw your description I have done several project like this. I'm an expert in Data Structures and Algorithms. And I know Java ,C/C++, C# and Python well. I'm interested this Project. I want Más

$100 USD en 2 días
(6 comentarios)

I have 2 years experience in c++ programming and I will get the task done in time with a well commented code

$25 USD en 3 días
(1 comentario)

Hi i can help u with this ................................................................ ........................... .......

$40 USD en 1 día
(0 comentarios)

Hi, my name is Cesar. I am a Systems Engineer with 7 years of experience on C/C++ programming and other OOP languages. Also, I have strong skills in ADT programming as you need. I think that i will finish your proje Más

$20 USD en 3 días
(0 comentarios)

Hi, You should learn to do tour home work(word of advice) I'm working as a software engineer so this work will be easy for me to do you can trust me Thank you

$25 USD en 1 día
(0 comentarios)