Finish Lab10

This commit is contained in:
2022-10-06 19:31:54 -05:00
parent 52ce289927
commit f4bc7fdca4
17 changed files with 801 additions and 12 deletions

View File

@@ -12,29 +12,31 @@ import java.util.Scanner;
*/
public class IndependanceUSA {
public static void main(String[] args)
{
public static void main(String[] args) {
// Setup vars
String month, day, year;
// Create scanner
Scanner input = new Scanner(System.in);
boolean conditionStillTrue = true;
// Prompt fo rinput
// 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") == 1) {
}
if (day.compareToIgnoreCase("4th" ) == 1) {
if (year == 1776) {
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!");
}
} else {
System.out.println("No, no, no! Incorrect!");
}
}
}
}