Gets input for temperature utilizing a branching statement


Question 1:

Write a java program called Question1 that does the following:
Initialize a counter to 0.
Get input for number of calculations to perform.
Calculations are to be performed in a looping structure.
Add 2 to the counter for each iteration inside the loop.
Output the value of the counter after the loop completes.
Be precise, import modules, include comments, prologue, etc. as needed.

Question 2:

Write a java program called Question 2 that does the following:
Gets input for temperature
Utilizing a branching statement:
If temperature is 76-100, call method outputHot passing the temperature input as an argument.
If temperature is 0-39, call method outputCold passing the temperature input as an argument.
If temperature is 40 to 75, call method outputJustRight passing the temperature input as an argument.
If temperature is outside these ranges, output "Temperature outside range" to the screen.
Be precise, import modules, include comments, prologue, etc. as needed.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Gets input for temperature utilizing a branching statement
Reference No:- TGS02392019

Now Priced at $15 (50% Discount)

Recommended (97%)

Rated (4.9/5)