Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Program 2 : Create a new Java project Loops 2 Create a class ( just like you did for Program 1 , Figure 1 New
Program :
Create a new Java project Loops
Create a class just like you did for Program Figure New Class
a name the class Loops
Enter the code as specified below
Run it by exercising all the menu options
Turn into the Dropbox as Loops
Program Specification:
Name Main Menu
Minimum
Guess a Random number between and
Temperatures
Quit
Enter Choice :
Create functions for each option: all functions called from main
Option : LowerNumber
Write a function that asks user for numbers and outputs the lower of the numbers. This
function just needs a simple if else structure.
Option : GuessRandomNumber
Generate a random number from
Ask the user to guess what the number is
The user is allowed 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; dont forget to import java util.Random
int randomNumber randlaen nextInt ;
your code here
Option : 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 hotpleasantcold 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
Pleasant: temperature
Cold: temperature
Do not use arrays or lists
Use separate counters or sum variables as needed
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started