/* 9/11/2017 Programming Process: 1. Understand problem 2. Develop and algorithm (use pseudocode) 3. Code in Java 4. Debug 5. Test */ /** * Javadoc: this class converts degrees celcius to * degrees faranheit. */ import java.util.Scanner; public class CelciusToFaran { /** main method does the work of the class (coversion) */ public static void main(String[] args) { double faran, celcius=100; boolean raining=false; Scanner input = new Scanner(System.in); // read in a degrees in celcius System.out.print("Enter a degrees in Celcius: "); celcius=input.nextDouble(); // calculate faranheit from celcius and print it faran = celcius * (9 / 5.0) + 32; System.out.println("faran=" + faran + " celcius=" + celcius); // print a msg if it is freezing if (faran<=32.0) System.out.println("It is freezing!"); // print a msg if it is very hot if (faran>=80) System.out.println("It is hot!"); System.out.print("Enter 1 if it is raining, 0 if it is not"); int num = input.nextInt(); if (num==1) raining=true; // use boolean variable as condition called a FLAG if (raining) { System.out.println("Take an umbrella!"); System.out.println("Take a rainjacket."); } } } /* Lab 5: * Read in two numbers, and print the larger of the 2 numbers. * For example, user enters 5 and 10, the program will print: * You entered 5 and 10. * The max value is 10. * If the two numbers are equal, print: * Both numbers are equal! * /