Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions