Question: Program 2 : Create a new Java project Loops 2 Create a class ( just like you did for Program 1 , Figure 1 New

Program 2:
Create a new Java project Loops 2
Create a class (just like you did for Program 1, Figure 1New Class)
a. name the class Loops 2
Enter the code as specified below
Run it by exercising all the menu options
Turn into the Dropbox as Loops 2.cpp
Program 2 Specification:
Name Main Menu
Minimum
Guess a Random number between 1 and 100?
Temperatures
Quit
Enter Choice (1,2,3,4) :
Create 3 functions for each option: (all functions called from main)
Option 1: LowerNumber
Write a function that asks user for 2 numbers and outputs the lower of the 2 numbers. This
function just needs a simple if else structure.
Option 2: GuessRandomNumber
Generate a random number from 1-100?
Ask the user to guess what the number is.
The user is allowed 10 guesses. Must use a for loop.
Give user a message if guess was too high or low
Give user a message if guess was right and how many tries it took
The top of the function should have:
Random randGen = new Random(); (don't forget to import java util.Random)
int randomNumber = randlaen nextInt (100)+1;
... your code here ...
Option 3: Temperatures
Write a function that
asks how many temperatures will be entered (following steps are in a loop)
asks for each temperature
outputs whether that temperature is hot/pleasant/cold (see below):
After this loop is complete (all temperatures have been entered)
outputs the maximum and minimum temperatures so far
outputs the average of temperatures entered so far
output the number of hot, pleasant and cold davs
Hot: temperature 85
Pleasant: temperature 60-84
Cold: temperature 60
Do not use arrays or lists
Use separate counters or sum variables as needed
 Program 2: Create a new Java project Loops 2 Create a

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!