Question
Pawn =1, Bishop=3, Knight =3, Rook=5, Queen=9 Write the program so that no more than 8 pawns, 2 knights, 2 bishops, 2 rooks, or 1
Pawn =1, Bishop=3, Knight =3, Rook=5, Queen=9
Write the program so that no more than 8 pawns, 2 knights, 2 bishops, 2 rooks, or 1 queen will be accepted as valid input. The "king" will cause the program to quit. Example:
Please input the name of each chess piece (pawn, knight, bishop, rook, queen or king). Inputting king will end the program.
Enter the name of piece 1: rook
A rook is 5 point(s). Your total is 5 point(s).
Enter the name of piece 2: rook
A rook is 5 point(s). Your total is 10 point(s).
Enter the name of piece 3: rook
Invalid piece name; there are no more rooks.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started