Question: Hi-Lo Game (with Dice) Netbeans/Java In this homework, you will be writing a program, which repeatedly asks the user if the next roll will be

Hi-Lo Game (with Dice)

Netbeans/Java

In this homework, you will be writing a program, which repeatedly asks the user if the next roll will be higher or lower than the last dice roll. You will continually play until the user types quit on a line by itself. The game will remember how many times you were successful and how many times you tried and report the ratio of success to tries after the user quits.

In addition, the game will maintain persistence: remembering you and how many times youve played even after exiting (by maintaining a file). You will need to ask the user for their user name prior to playing and use that to record their results in a file. If the user has played before, the number of successful tries and the number of tries is in a file named after the user with a .txt extension. If not, we start at zero for that user. Once the user quits, youll need to save the new results into the correct file.

a) (10%) Your dialog should be clear each time you ask for something what you are asking for and output the result. Note: you should also inform the user what you consider correct and what will end the game for the user.

b) (20%) Logic reading/determining the hi/lo/quit (in its own method)

c) (20%) Logic providing the dice rolls(note: youll need a dice roll to begin)should be in its own method

d) (30%) Logic providing the persistence (3 methods) which includes: i) Determine if the file exists (1 method) (1) Hint: File has a method called exists() which returns true or false depending on whether or no the file exists

ii) Opening the file, reading the number correct and the number of tries (each on their own line) (1 method) iii) Once finished, rewriting the file so that it contains current data ( 1 method)

e) (20%) The logic providing the rest of the result (managing the play, keeping score, calculations)

f) Name your program: DiceHILO.java

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!