Question: Hit a nine In this task you are to create a program called Nine.java which will simulate a simple game using selection (no iteration, only

 Hit a nine In this task you are to create a

Hit a nine In this task you are to create a program called Nine.java which will simulate a simple game using selection (no iteration, only one play- through per execution). The game is one using two normal six sided dice. You play against the computer and the objective is to get as close to nine as possible, but not more. The game works as follows. Both you and the computer have two possible dice to roll. First you roll a die and then decide if you would like to roll another. When you are done, that is if you decide to roll another or to skip the second roll, it is time for the computer to do the same. The computer rolls the first die and if it is four or lower, it will roll anther, otherwise it will skip the second roll. When both players have done their rolls, the program should calculate who, if anyone, won. As stated, the one closest to nine wins, unless it is ten or more. If either player gets ten or more, the player is declared "fat" and automatically loses

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!