Question: This is what I've for code so far! import java.util.Random; import java.util.Scanner; import java.io.IOException; import java.io.PrintWriter; import java.io.FileWriter; public class QuizNumberFour { public static void

This is what I've for code so far!
import java.util.Random;
import java.util.Scanner;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.FileWriter;
public class QuizNumberFour {
public static void main(String[] args) throws IOException
{
String firstintial,
lastintial;
int guess = 0;
int answer = 0;
int tries = 0, upper = 100;
int randomnumber = 1 + (int) (Math.random() * 99);
PrintWriter outputFile = new PrintWriter("wins.txt");
Scanner keyboard = new Scanner(System.in);
Random r = new Random();
System.out.println ("Try your Hand at the Guess the Number Game *************************** ");
System.out.println ("Enter the Intial of Your First Name");
System.out.println("Enter the the Intial of Your Last Name");
System.out.println ("Take your best shot!!! ");
do
{
System.out.print("Enter number: ");
guess = keyboard.nextInt();
tries++;
if (guess
System.out.println("too low! ");
else if (guess > answer + 10)
System.out.println("Way too high! ");
else if (guess > answer)
System.out.println("Too high! ");
else if (guess == answer)
{
System.out.println("You got it in " + tries + " tries.");
if (tries
System.out.println("Great work! You are a mathematical wizard. ");
else if (tries >3 && tries
System.out.println("Not too bad! You've got some potential. ");
else if (tries > 7)
System.out.println("What took you so long? Maybe you should take some lessons. ");
}System.out.println("Data Written");
outputFile.close();
System.exit(0);
} while (guess != answer);
}
}
Operation e Create a menu as follows 1. Play game 2. Print Report lf user selects 1, do the operations and specifications to play game. If user selects 2, open and display the data as column data: Handle Score ins Crushlt 0 Top Score is Wins with a 5! The program prompt the user to enter their "handle .The application prompts the user to enter an int value from 1 to 100 until the user guesses the random number that the application has generated. The application displays messages that indicate whether the user's guess is too high or too low. . When the user guesses the number, the application displays the number of guesses along witha rating. Then, the application asks if the user wants to play again. . When the user exits the game, the application displays a goodbye message.Specifications .If the user's guess is more than 10 higher than the random number, the application should say, "Way too high!" .If the user's guess is higher than the random number, the application should say, "Too high!" .If the user's guess is lower than the random number, the application should say, "Too low! .The message that's displayed when the user gets the number should vary depending on the number of guesses. For example: Nunber of guesses Message Great vork! You are a mathenatical vizard Not too bad! Yau ve got sone potential What took you so long? beyou should take some les sons >3 and
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
