Question: JAVA PROGRAMMING: Modify your code so that it uses the following methods: o public static char displayMainMenu() should prompt for and return the main menu

JAVA PROGRAMMING:

Modify your code so that it uses the following methods: o

public static char displayMainMenu() should prompt for and return the main menu choice.

public static void displayRules() should display the rules to the user.

public static int processQuestion(string q1, string ansA, string ansB, string ansC, string ansD, char correctAns, int pointValue) should display a question and its corresponding 4 answers, prompt for the correct answer and display correct/incorrect to the user. The function should also return the points that the user received. If the user answers incorrectly, return a value of zero.

public static int readInHighScore() should open highscore.txt, read in the high score, close the file and return the high score.

public static void compareScore(int highScore, int userScore) should compare the users score to the high score that was read from the file. If the users score is greater, open the high score file, replace the high score, and close the file. Otherwise, do not modify the file.

public static void displayScore(int score) should display the users current total. This should be called after each question is answered.

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!