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 5

Calculate the temperature (again) with functions

Write a Celsius / Fahrenheit conversion program (reuse some of the code from prior assignments)

Have the program convert a Fahrenheit temperature to a Celsius temperature. The program should display the converted results then prompt for another input value until the user requests an exit.

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".

Functions:

Seperate functions should be written to:

  1. Prompt for each input value
    No data passed to function / Data returned from function
  2. Perform the calculation
    Data passed to function / Data returned from function
  3. Display the result
    Data passed to function / No data returned from function

Formulas:

F = (1.8 * C) + 32

Test values:

Fahrenheit: 32, 100, 212 plus several of your choosing

Input:

  • none

Sample Output:


prompt>Enter the Fahrenheit temperature [ctrl-z to exit]: 212

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

prompt>Enter the Fahrenheit temperature [ctrl-z to exit]:

...

Turn in:

  1. Program listing
  2. Program output

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