Question: A HighScore.java 3 X HighScore.java > HighScore public class HighScore { //methods (s) for reading and validating //user input and creating a new DataType

A HighScore.java 3 X HighScore.java > HighScore public class HighScore { //methods

A HighScore.java 3 X HighScore.java > HighScore public class HighScore { //methods (s) for reading and validating //user input and creating a new DataType //this is the reading GameScore Method 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 } //calling the method to read the detials from the user //and assigns results to information Run | Debug public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.println("Enter score information: "); GameScore gameScore = readGameScore(); System.out.println("You entered: "); System.out.println (gameScore); } GameScore.java //printing the game score information public static GameScore readGameScore() { GameScore gameScore; Scanner in = new Scanner(System.in); System.out.print("Enter player name: "); String playername = in.nextLine(); System.out.print("Enter game ID: "); int gameId = in.nextInt (); } int score =-1; while (score < 0) { } System.out.print("Enter score: "); score = in.nextInt (); if (score < 0) { System.out.println("Score must be positive value"); } gameScore = new GameScore (playername, gameId, score); return gameScore;

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 Programming Questions!