Question: Java 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

Java

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!