In: Computer Science
Please use Java Eclipse and show code/output
Please create a program that determines when a good day to go to the beach is.
Please use the users input and its returning output.
If the weather is 70 degree or greater, the program should say yes it is a good day to go
If the weather is less than 70 degrees to say no the weather is not a good day to go
import java.util.Scanner;
public class GoodDay {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter the temperature : ");
float temp = sc.nextFloat();
if(temp >= 70) {
System.out.println("Yes, It is a Good day to go !");
}else {
System.out.println("No, the weather is not a good day to go");
}
sc.close();
}
}
Code
Output
Testcase #1
Testcase #2