43 lines
1.2 KiB
Java
43 lines
1.2 KiB
Java
/*
|
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
|
*/
|
|
package lab10_calebfontenot;
|
|
|
|
import java.util.Scanner;
|
|
|
|
/**
|
|
*
|
|
* @author caleb
|
|
*/
|
|
public class IndependanceUSA {
|
|
|
|
public static void main(String[] args) {
|
|
// Setup vars
|
|
String month, day, year;
|
|
|
|
// Create scanner
|
|
Scanner input = new Scanner(System.in);
|
|
boolean conditionStillTrue = true;
|
|
// Prompt for input
|
|
System.out.println("Please enter the date of Independence. (Month, day, year): ");
|
|
month = input.next();
|
|
day = input.next();
|
|
year = input.next();
|
|
|
|
if (month.compareToIgnoreCase("july") == 0) {
|
|
if (day.compareToIgnoreCase("4th") == 0 || (day == "4")) {
|
|
if (year.compareToIgnoreCase("1776") == 0) {
|
|
System.out.println("Hurrah!");
|
|
} else {
|
|
System.out.println("No, no, no! Incorrect!");
|
|
}
|
|
} else {
|
|
System.out.println("No, no, no! Incorrect!");
|
|
}
|
|
} else {
|
|
System.out.println("No, no, no! Incorrect!");
|
|
}
|
|
}
|
|
}
|