Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

File Guessing.java contains a skeleton of a program that plays a simple guessing

ID: 3528239 • Letter: F

Question

File Guessing.java contains a skeleton of a program that plays a simple guessing game with the user. Using the comments as a guide, complete the program so that it prints out the result of the guessing. //******************************************************************* // Guessing.java // //******************************************************************* import java.util.*; public class Guessing { //----------------------------------------------------------------- // Plays a simple guessing game with the user. //----------------------------------------------------------------- public static void main (String[] args) { final int MAX = 10; int answer, guess; Scanner scan = new Scanner (System.in); Random generator = new Random(); // create a random number between 1 and MAX and store it in answer System.out.print ("I'm thinking of a number between 1 and " + MAX + ". Guess what it is: "); guess = scan.nextInt(); // complete the while loop so that the program will keep // asking the user to try again until the user

Explanation / Answer

//please rate


package practicePackage;

//*******************************************************************
// Guessing.java
//
//*******************************************************************
import java.util.*;
public class Guessing {
//-----------------------------------------------------------------
// Plays a simple guessing game with the user.
//-----------------------------------------------------------------
public static void main (String[] args) {
final int MAX = 10;
int answer, guess;
Scanner scan = new Scanner (System.in);
Random generator = new Random();
// create a random number between 1 and MAX and store it in answer
answer=generator.nextInt(MAX)+1;
System.out.print ("I'm thinking of a number between 1 and " + MAX + ". Guess what it is: ");
guess = scan.nextInt();
// complete the while loop so that the program will keep
// asking the user to try again until the user

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote