1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
motikmotik
4 years ago
13

Write a program that plays a number guessing game with a Human user. The Human user will think of a number between 1 and 100, in

clusive. The program will make guesses and the user will tell the program to guess higher or lower.
Computers and Technology
1 answer:
almond37 [142]4 years ago
6 0

Answer:

<em>import java.util.Random;</em>

<em>import java.util.Scanner;</em>

<em>public class ANot {</em>

<em>    public static void main(String[] args) {</em>

<em>      Scanner in = new Scanner(System.in);</em>

<em>      Random rand = new Random();</em>

<em>      int randomNum = rand.nextInt(100)+1;</em>

<em>      System.out.println("ENTER A NUMBER TO PLAY");</em>

<em>      int userNum = in.nextInt();</em>

<em>      if(userNum<randomNum){</em>

<em>          System.out.println("Guess Higher");</em>

<em>      }</em>

<em>      else if(userNum>randomNum){</em>

<em>          System.out.println("Guess Lower");</em>

<em>      }</em>

<em>      else{</em>

<em>          System.out.println("CORRECT GUESS");</em>

<em>      }</em>

<em>    }</em>

<em>}</em>

Explanation:

  1. Use the Random class in Java to generate a random number
  2. Save the random number in a variable
  3. Use the Scanner Class to prompt user to enter a number as a guess
  4. Save the user input in a variable
  5. Use if/elseif/else statements to compare the random number and the number entered by the user.

You might be interested in
On the Audio Tools contextual tab, which tab will control how the audio file appears, if it appears, on the slide itself?
otez555 [7]

Answer:

<h2>B. Playback</h2>

Explanation:

Playback is the act of reproducing recorded sound; “he was allowed to hear the playback of his testimony”. The part of a tape recorder that reproduces the recorded material.

On the audio tools contextual tab, “playback” will control how the audio file appears, if it appears, on the slide itself.

Therefore, the correct answer is b. playback.

5 0
3 years ago
Read 2 more answers
Choose which statement is wrong by applying your knowledge from the reading. a. A security manager works on tasks identified by
Novosadov [1.4K]

There are reasons why a statement can be wrong. The option that is a wrong statement is Since 2015, the number of unfilled cybersecurity positions has increased by 10 percent.

<h3>How are many cybersecurity jobs unfilled?</h3>

The U.S. is known to have a high total employed cybersecurity workforce and some that are unfilled positions as reported by Cyber Seek.

Studies has shown that since 2015, the number of unfilled cybersecurity positions has gone up by 50 percent. Such that  the total expected rate has been approximated to be at 1.8 million open cybersecurity positions by 2022.

Learn more about cybersecurity from

brainly.com/question/14286078

8 0
2 years ago
What is work immersion and its nature​
Kobotan [32]
Work Immersion refers to the subject of the Senior High School Curriculum, which involves hands-on experience or work simulation in which learners can apply their competencies and acquired knowledge relevant to their track.
3 0
3 years ago
Type the correct answer in the box.
tatuchka [14]

Answer:

User can make the network name

7 0
3 years ago
How does Shakespeare immediately introduce Tybalt as a menacing character?
Scilla [17]

The correct answer to this open question is the following.

Although there are no options attached we can say the following.

William Shakespeare immediately introduces Tybalt as a menacing character in the first moments of the play "Romeo and Juliet" because Tybalt is an aggressive man who does not support the idea of peace or get peaceful agreements to solve problems. Tybalt does not like the Montague people.

“The tragedy of Romeo and Juliet” was written by the English writer William Shakespeare approximately in 1590 and is considered to be a play in a poetic form. It refers to the story of two lovers that belonged to opposite families in dispute. Their love is forbidden. Eventually, both lovers die and that is the reason for their families to reconcile.

5 0
3 years ago
Other questions:
  • You are designing a distributed application for Azure. The application must securely integrate with on-premises servers. You nee
    13·2 answers
  • In which area of engineering does material selection play a vital role a design optimization b forensic engineering c mechanical
    6·1 answer
  • What are the changes in ios 14.2? What are the benefits of the ios developer program? What is next for Apple? Base your answers
    14·1 answer
  • ​What file system below does not support encryption, file based compression, and disk quotas, but does support extremely large v
    10·1 answer
  • Write a statement that declares a PrintWriter reference variable named output and initializes it to a reference to a newly creat
    5·1 answer
  • Systems thinking includes consideration of all of the following EXCEPT
    9·1 answer
  • Someone help please!! i’ll give brainliest
    11·2 answers
  • HEEEEEEEEEEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLPPPPPPPPPPPPPPPPPPPPPPPPPPP
    12·2 answers
  • Write a function that will sum all of the numbers in a list, ignoring the non-numbers. The function should takes one parameter:
    8·1 answer
  • What game is a great example of a story unfolding as the levels increase where the player learns more about the plight of the pr
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!