Skip to content

Commit 7d433cc

Browse files
committed
InputTest
1 parent b547d70 commit 7d433cc

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Part3/InputTest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import java.util.*;
2+
3+
public class InputTest {
4+
public static void main(String[] args) {
5+
Scanner in = new Scanner(System.in);
6+
String name = in.nextLine();
7+
8+
System.out.print("How old are you?");
9+
int age = in.nextInt();
10+
11+
System.out.println("Hello, " + name + ". Next year, you'll be " + (age + 1));
12+
}
13+
}
14+

0 commit comments

Comments
 (0)