Docsity

INF 231Temperature ConversionINF 231 Programming Concepts In, Lecture notes of Accounting

Toggle sidebar
bg1
INF 231
Temperature Conversion
INF 231 Programming Concepts
Introd
uction
This user guide explains how the java program referenced can be used to
convert Fahrenheit to Celsius with a few simple steps. When the user accesses the
program, they can enter their Fahrenheit temperature into the program, and will be
given the Celsius equivalent. The program will then give them the option to continue
with more temperatures or end their session. This user guide will explain how the
program works.
Program
Snapshot
Progra
m Code
pf3

Partial preview of the text

Download INF 231Temperature ConversionINF 231 Programming Concepts In and more Lecture notes Accounting in PDF only on Docsity!

INF 231

Temperature Conversion INF 231 Programming Concepts Introd uction This user guide explains how the java program referenced can be used to convert Fahrenheit to Celsius with a few simple steps. When the user accesses the program, they can enter their Fahrenheit temperature into the program, and will be given the Celsius equivalent. The program will then give them the option to continue with more temperatures or end their session. This user guide will explain how the program works. Program Snapshot Progra m Code

import java.util.Scanner; public class FinalTemp { private static final String FinalTemp = null; public static void main (String [] argus) { { String cont = ""; do { double celsius, fahrenheit; //create Scanner and request fahrenheit temp from user Scanner s = new Scanner(System.in); System.out.println("what is the temp in Fahrenheit?"); //verify user enters a valid F temp while (!s.hasNextDouble()) { s.next(); System.out.println("Please enter valid temperature"); } fahrenheit = s.nextDouble(); celsius = (fahrenheit - 32) * 5.0 / 9.0; String strCelsius = String.format("%.2f", celsius); System.out.println("Temp in Celsius is: " + strCelsius); System.out.println("Continue? (Y/N)"); cont = s.next(); } while(cont.equalsIgnoreCase("Y")); Kerry Trafton"); System.out.println("Hello Instructor Fekete, This is the INF231 Final Assignment for: