C Programming

posted by .

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.

  • C Programming -

    If you have started programming, you are probably aware that there are three steps to follow:
    1. understand the requirements, the input supplied, and the output desired, including the format and the calculations involved. The result of this phase is documentation.
    2. Plan how you will satisfy the requirements, design your algorithm and program flow. Most of the time these consist of the standard steps of input-calculations-output.
    The result of this phase of work is a pseudocode. Something similar to a flow chart, but in words, and in a language similar to but independent of a computer language.
    3. coding.
    From the pseudocode, you will code the program so that it will execute smoothly according to the requirements. This phase will include thorough testing to ensure there are no syntax or logical errors in your coding. The result of this phase is an executable program.

    Can you examine your project to see where you're at, and where you encounter difficulties? We will be glad to help at any stage of the project, but cannot without input from you.

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. C programming

    I'm suppose to write a program using functions and modules that accepts six names from the user and print it back to the screen. It should then ask the user which name they want deleted and print to the screen all the other names except …
  2. C Programming

    This is what the program needs to do: 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. How would I store the input when …
  3. writting a program

    Speed of Sound. Sound travels through air as a result of collisions between the molecules in the air. The temperature of the air affects the speed of the molecules, which in turn affects the speed of sound. The velocity of sound in …
  4. programming MIPS ask

    Write a MIPS assembly language program that will cover the following steps: Prompt the user to enter a first integer named i1 Prompt the user to enter a second integer named i2 Compute i1+i2-200 Print the value of the result Repeat …
  5. Computer Science

    write a program that will prompt the user for a value and print the value entered to the screen. The program stops when the user enters a value less than zero. I need an IPO chart, pseudocode and C++
  6. programming

    Write a program which allows user to enter 10 student names and scores for Java programming 1 and Java programming 2. Allow user to choose which course they want to enter the record for. Use the loop to ask input from user. The program …
  7. java.please help

    Write a Java program that prompts the user for a string. If the string entered by the user does not start with Hello and does not end with a digit, print incorrect and re-prompt the user. Otherwise, print Thank you.
  8. c++ programming

    I need some help with my homework please Write a C++ program to prompts the user to enter the first character of shape name (Cycle, Rectangle, or Triangle). Then calculate the area of that shape. „h If the user enters another character …
  9. Programming

    Design and plan the logic for a program that prompts the user for and allows the user to enter TWO numbers. The program outputs the sum of the two values. Provide declarations.
  10. C++

    // Program: name of program // Author: your name // Date Written: date you began writing the program /* Abstract: Brief description of the program */ Include in-line comments in the body of your program. You can convert temperature …

More Similar Questions