Computer Science, asked by gunasweet777, 7 months ago

Carrom

If Cricket is the most popular outdoor game in India, Carrom is not too behind as one of most played indoor games.
Let's now make use of our knowlege in operators & conditional statements to compute the points scored at the end of a round in Carrom Game.

Carrom is a board game where two participants (teams) play. It consists of 9 white coins, 9 black coins and a red coin. The first team that finishes all their coins wins (given that red has been pocketed by one of the teams). The points are awarded based on the number of left-over coins of the opposition (loser) in the board. If the winning team has pocketed the red, they get an additional 5 points. Write a program to compute the score of winner at the end of a round.

If the number of coins left on the board is either less than 1 or greater than 9 display "Invalid Input".
Create a main class with the name "Main".

Input Format:
Input consists of a single integer which corresponds to number of coins left on board and a character which corresponds to whether the winning team has pocketed red or not.

Output Format:
Output corresponds to the total points won.
Print Invalid Input in case the no of coins is less than one or greater than nine.
[All text in bold corresponds to input and the rest corresponds to output]

Answers

Answered by ankan2778
2

Answer:

Cricket, Football and Baseball are games that require a large ground or field to be played. They are outdoor games.

Table tennis is also known as ping pong and is played on a table having a small net. The game is played using a bat and small ping pong ball.

Similar questions