Tuesday
May 21, 2013

Homework Help: C Programming

Posted by gnozahs on Thursday, September 24, 2009 at 11:20am.

Write a program that prompts the user to enter a temperature, followed by a letter representing Celsius
(C) or Fahrenheit (F). Then prompt the user for the conversion type and print the results to the screen
with one decimal point. If the user enters a letter other than 'C' or 'F', the program should print an error
message.
Specifications:
You must use the switch statement for this program, and the program should be able to recognize
lowercase ('c' or 'f') or uppercase ('C' or 'F') letters for Celsius or Fahrenheit temperatures. If you
execute the program with the following inputs, the following information should be displayed:

Enter a temperature: 32.4
Enter 'C' for Celsius or 'F' for Fahrenheit: C
Choose a conversion ('C' for Celsius or 'F' for Fahrenheit): F
The temperature is: 90.3 F.

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

writting a program - Speed of Sound. Sound travels through air as a result of ...
C Programming - This is what the program needs to do: Enter a temperature: 32.4 ...
Fund of programming 1 - Complete the following C++ program. The program should ...
computer science - in one the chapter 3 programming challenges you were asked to...
programming MIPS ask - Write a MIPS assembly language program that will cover ...
C Programming - Okay, question. What if I inputted this: Enter a temperature: 32...
programming - develop a program that converts inches to centimeters(1 inch=2.54 ...
computer science - You are required to use the Account class to simulate an ATM ...
Algebra - The folrmula F=9/5c+32 can be used to make temperature conversions ...
programming - How to write a program to create a class roster using an array? ...

For Further Reading

Search
Members
Community