Kean.edu
General
Home
About
Educational
Kean University
MSAS5004
Intro to Programming
MSAS5040
Intro to e-Business
MSAS5104
Intro to Programming
MSAS5302
Decision Support Systems
MSAS5599
Web Site Design
Caldwell College
CS115
Intro to Computers
CS185
Intro to Programming
Business
Recycled Fiber Apparel
Little Jammies
Tie Dye Mania
Just Neon Tees
No Buttons Required
Panda Apparel LLC
Betty Boop Gear
Panda Imprinting
Custom Printed Boxers
Custom Printed Lounge Pants
Panda Formals
DSM Internet Services

 

Assignment 3

Calculate the temperature

Write a Celsius / Fahrenheit conversion program

Have the program prompt for a C -> F (Celsius to Fahrenheit) or F -> C (Fahrenheit to Celsius) conversion and convert the temperature as required.

The prompts should indicate the expected values for "convert from"

If the result is at or below freezing or at or above boiling the result should print an extra message of "That’s cold" or "That’s hot".

Formulas:

F = (1.8 * C) + 32
C = (F - 32) / 1.8

Test values:

Celsius: 0, 50, 100
Fahrenheit: 32, 100, 212

Input:

  • none

Sample Output:

prompt>Enter the conversion type [F,C]: F
prompt>Enter the Fahrenheit temperature: 212

212 degrees Fahrenheit is 100 degrees Celsius - That's Hot

Turn in:

  1. Program listing
  2. Program output

Copyright© 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 All rights reserved.