Skip to content

Commit

Permalink
feat(3.3.3): Finished U3_L3_Activity_Three
Browse files Browse the repository at this point in the history
  • Loading branch information
101zh committed Oct 10, 2023
1 parent c580734 commit 853afdd
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/main/java/Unit3/U3_L3_Activity_Three.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package Unit3;

import java.util.Scanner;

public class U3_L3_Activity_Three {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Enter in two Integers");
System.out.print("> ");
int num1 = scanner.nextInt();
System.out.print("> ");
int num2 = scanner.nextInt();

int ans = num1 + num2;

System.out.println("\n" + num1 + " + " + num2 + " = ?");
System.out.print("> ");
int guess = scanner.nextInt();

if (ans == guess) {
System.out.println("Correct!");
} else {
System.out.println("Wrong");
}

scanner.close();
}
}

0 comments on commit 853afdd

Please sign in to comment.