Skip to content

Commit da271db

Browse files
author
Kathryn Hodge
committed
Starting 04_02b
1 parent cbeb601 commit da271db

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/Main.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,25 @@ public static void main(String args[]) {
88
String choiceTwo = "jupiter";
99
String choiceThree = "saturn";
1010

11-
String correctAnswer = choiceTwo;
11+
String correctAnswer = choiceThree;
1212

1313
// Write a print statement asking the question
1414
System.out.println(question);
1515

1616
// Write a print statement giving the answer choices
1717
System.out.println("Choose one of the following: " +
18-
choiceOne + ", " + choiceTwo + ", or " + choiceThree + ".");
18+
choiceOne + ", " + choiceTwo + ", or " + choiceThree + ".")
1919

2020
// Have the user input an answer
2121
Scanner scanner = new Scanner(System.in);
2222
// Retrieve the user's input
2323
String input = scanner.next();
2424

25-
// If the user's input matches the correctAnswer...
26-
// then the user is correct and we want to print out a congrats message to the user.
2725
if(correctAnswer.equals(input.toLowerCase())) {
2826
System.out.println("Congrats! That's the correct answer");
2927
} else {
3028
System.out.println("You are incorrect. The correct answer is " + correctAnswer);
3129
}
32-
// If the user's input does not match the correctAnswer...
33-
// then the user is incorrect and we want to print out a message saying that the user is incorrect as well as what the correct choice was.
34-
3530
}
3631

3732
}

0 commit comments

Comments
 (0)