There are 3 parts to each question. Please give me the code for all the 3 parts . Any kind of help is appreciated . Thank you. Question 1 : Write an application that converts temperatures between the...



There are 3 parts to each question.  Please give me the code for all the 3 parts . Any kind of help is appreciated . Thank you.



Question 1 :


Write an application that converts temperatures between the Fahrenheit and Celsius scales.


The interesting aspect of the application is that the input controls which direction (i.e., calculation) to calculate. The user is
prompted to enter both the temperature and the scale it is in (as the words “Cel” or “Fahr” in upper, lower, or mixed case);
if the scale is invalid, display an error message. The result is the conversion in the alternate scale (see examples).


Formulas: F → C: (F – 32) * (5/9) = C
C → F: C * (9/5) + 32 = F



OUTPUT:


Run 1:


Temperate and scale: 10.10 Cel
Conversion: 50.18 Fahrenheit


Run 2 :


Temperate and scale: -40.0 FAHR
Conversion: -40.00 Celsuis



Part 1

-Complete a well-structured & well-written program as described above.


-You can include methods that help reduce the complexity
of the main() method. Include commenting, and test with sufficient values to ensure the program works as expected (and consider
“simple” values, such as 0.0, 1.0, and -40.0, in both directions, to clearly show calculations are correct).


-Capture the output of running this program with your test values.



Part 2

Save as a new application name, and adjust the program to perform an “automatic” and random calculation:


- Rather than ask the user, the program randomly selects: a) temperature (between -10 and +10); and b) scale (“Fahr” or “Cel”)


- Display the random temperature and scale, perform the appropriate calculation, and display the result.


-Capture the output of running this program 5 or 6 times.



Part 3

Adjust the program from Part 2, with the following,


- Prompt the user for the “number of random calculations” (# of iterations)


- Use this value to perform the “automatic” calculation program that many times, generating a new random temperate and scale for each iteration.


-Capture the output of running this program with a couple of different values for # or iterations.

Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here