import java.util.*;
import java.lang.*;
public class numberGuess {
public static void main(String[] args) {
int max = 200, min = 1;
int range = (max - min) + 1;
int x = (int)(Math.random() * range) + min;
int tries = 0, guess;
System.out.println("Guess a guess between 1 and 200 : ");
Scanner input = new Scanner(System.in);
do{
guess = input.nextInt();
if (guess < 1 || guess > 200){
System.out.println("That is not a valid entry. Please try again: ");
}else if (guess > x){
System.out.println("Your guess was too high. Try again.");
}else if (guess < x){
System.out.println("Your guess was too low. Try again.");
}
tries++;
} while (guess != x);
System.out.println("Congratulations! Your guess was correct!");
System.out.println("I had chosen " + guess + " as the target number.");
System.out.println("You guessed it in " + tries + " tries.");
if(tries == 1)
System.out.println("That was astounding!");
else if(tries>=2 && tries<=4)
System.out.println("That was lucky!");
else if(tries>=5 && tries<=6)
System.out.println("That was pretty good.");
else if(tries == 7)
System.out.println("That was not that impressive.");
else if(tries>=8 && tries<=9)
System.out.println("Are you sure this is the right game for you?");
else if(tries>=10)
System.out.println("This just isn't your game, is it?");
}
}

For this lab you will write a Java program using a loop that will play a...
Write a program to play "guess my number". The program should generate a random number between 0 and 100 and then prompt the user to guess the number. If the user guesses incorrectly the program gives the user a hint using the words 'higher' or 'lower' (as shown in the sample output). It prints a message 'Yes - it is' if the guessed number is same as the random number generated. ANSWER IN C LANGUAGE. ====================== Sample Input / Output:...
Hello! we are using Python to write this
program. we are supposed to use loops in this assignment. I would
greatly appreciate the help! Thank you!
Write a program that allows the user to play a guessing game. The game will choose a "secret number", a positive integer less than 10000. The user has 10 tries to guess the number. Requirements: we would have the program select a random number as the "secret number". However, for the purpose of testing...
This program will implement a simple guessing game... Write a program that will generate a random number between 1 and 50 and then have the user guess the number. The program should tell the user whether they have guessed too high or too low and allow them to continue to guess until they get the number or enter a 0 to quit. When they guess the number it should tell them how many guesses it took. At the end, the...
IN BASIC JAVA and using JAVA.UTIL.RANDOM write a program will randomly pick a number between one and 100. Then it will ask the user to make a guess as to what the number is. If the guess is incorrect, but is within the range of 1 to 100, the user will be told if it is higher or lower and then asked to guess again. If the guess was outside the valid range or not readable by Scanner class, a...
Write a program that prompts the user for an integer that the player (maybe the user, maybe someone else) will try to guess. If the player's guess is higher than the target number, the program should display "too high" If the user's guess is lower than the target number, the program should display "too low" The program should use a loop that repeats until the user correctly guesses the number. Then the program should print how many guesses it took....
Required in JAVA language Write a program that enables a user to play number guessing games. The following is a nutshell description of a number guessing game. + a random number is generated + loop prompting the user to enter guesses until the user guesses the number or hits the maximum number of allowed guesses or enters the "quit" sentinel value The rest of this specification documents number guessing games in more detail. The documentation uses manifest constants that can...
For this lab you will write a Java program that plays a simple Guess The Word game. The program will prompt the user to enter the name of a file containing a list of words. These words mustbe stored in an ArrayList, and the program will not know how many words are in the file before it starts putting them in the list. When all of the words have been read from the file, the program randomly chooses one word...
Can someone upload a picture of the code in
matlab
Write a "Guess My Number Game" program. The program generates a random integer in a specified range, and the user (the player) has to guess the number. The program allows the use to play as many times as he/she would like; at the conclusion of each game, the program asks whether the player wants to play again The basic algorithm is: 1. The program starts by printing instructions on the...
Write a Java Program to allow a user to guess a person’s age until they get it correct. After each guess, the user must be told whether their guess was correct, too high or too low. Once the user enters the correct age, the program must display how many guesses it took the user to guess the correct age.
Write a Java application program that plays a number guessing game with the user. In the starter code that you are given to help you begin the project, you will find the following lines of code: Random generator = args.length == 0 ? new Random() : new Random(Integer.parseInt(args[0])); int secret = generator.nextInt(100); You must keep these lines of code in your program. If you delete these lines, or if you change thse lines in any way, then your program...