ITP109_Lab4

# ITP109_Lab4 - If anything other than C, c, F, or f is...

This preview shows page 1. Sign up to view the full content.

ITP 109 Lab 4 Goal You will practice using if-else statements and boolean expressions. Assignment Write a program that allows the user to convert a temperature given in degrees from either Celsius to Fahrenheit or Fahrenheit to Celsius. Use the following formulas: Degrees_C = 5 (Degrees_F - 32) / 9 Degrees_F = (9 (Degrees_C) / 5) + 32 Prompt the user to enter a temperature and either a C or c for Celsius or an F or f for Fahrenheit. Convert the temperature to Fahrenheit if Celsius is entered, or to Celsius if Fahrenheit is entered. Display the result in a readable format.
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: If anything other than C, c, F, or f is entered, print an error message. Create your program using Eclipse. Your project should be named Lab4 , and your Java class should be named Lab4 . Use the Scanner class to get input from the user, and use System.out to print to the console window. Make sure to comment your code. Grading - 15 points total 5 points: Input of data 5 points: Convert temperature 5 points: Display result If you do not comment your code, points will be deducted....
View Full Document

## This note was uploaded on 10/15/2008 for the course ITP 109x taught by Professor Trinagregory during the Spring '08 term at USC.

Ask a homework question - tutors are online