Answered step by step
Verified Expert Solution
Question
1 Approved Answer
For this assignment, you will create a new Netbeans project and follow all instructions as given for each part of the assignment. Turn-in Instructions: Once
For this assignment, you will create a new Netbeans project and follow all instructions as given for each part of the assignment. Turn-in Instructions: Once finished, put everything into a directory named LastNameFirstName-Homework3 and zip that directory (which should result in a zip file named LastNameFirstName-Homework3.zip) and turn in via blackboard by the due date. No late homeworks will be accepted since the solution will appear on the deadline! Hi-Lo Game (with Dice) 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 you've 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, you'll 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 (20%) Logic reading/determining the hi/lo/quit (in its own method) (20%) Logic providing the dice rolls (note: you'll need a dice roll to begin) should be in its own method (30%) Logic providing the persistence (3 methods) which includes i) Determine if the file exists (1 method) b) C) d) (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) e) f) Once finished, rewriting the file so that it contains current data (1 method) (2096) The logic providing the rest of the result (managing the play, keeping score, calculations) Name your program: DiceHILO.java
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