Question: B - Temperatures You may use the CodeCheck IDE directly to write this program. (Your program will be graded by CodeCheck). Here are the requirements:

B - Temperatures

You may use the CodeCheck IDE directly to write this program. (Your program will be graded by CodeCheck). Here are the requirements:

  • Complete the class Temperatures (you must use this exact name to pass CodeCheck) so that it prompts the user for a temperature value, followed by a character that represents the type of temperature.

  • The second input value is the string "F" for Fahrenheit or "C" for Celsius.

  • If the string is an "F", the temperature read was Fahrenheit, which needs to be converted to Celsius.

  • If the string is an "C", the temperature read was Celsius, which needs to be converted to Fahrenheit.

  • If the character represents Fahrenheit temperature (F), convert the temperature value to the equivalent value in Celsius, using the following formula:

C = (5/9)(F - 32.0)

  • where C represents the Celsius temperature value, and F represents the Farhenheit temperature value.

  • If the character represents Celsius temperature (C), convert the temperature value to the equivalent value in Farhenheit, using the following formula:

F = (9/5)C + 32.0

  • The converted temperature is then printed.

  • http://codecheck.it/files?repo=jfe1cc&problem=ch03/c03_exp_3_102

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!