/home/caleb/ASDV-Java/lab6_CalebFontenot/src/main/java/com/calebfontenot/lab6_calebfontenot/IfElse3.java |
nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt
nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java
package com.calebfontenot.lab6_calebfontenot;
import java.util.Scanner;
public class IfElse3 {
public static void main(String[] args) {
System.out.print("Please type today's temperature and I will comment on it: ");
Scanner scan = new Scanner(System.in);
double todaysTemperature = scan.nextDouble();
if ( todaysTemperature >= 120)
System.out.println("Come on dude! Be serious!");
else if ( todaysTemperature >= 100)
System.out.println("Very, very hot at " + todaysTemperature + "!");
else if ( todaysTemperature >= 85)
System.out.println("hot at " + todaysTemperature);
else if ( todaysTemperature >= 70 )
System.out.println("Pleasant at " + todaysTemperature);
else if ( todaysTemperature >= 40 )
System.out.println("A bit cold at " + todaysTemperature);
else
System.out.println("bbbrrrrrrr at " + todaysTemperature + "!");
}
}