-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMadLibsGame.java
More file actions
41 lines (23 loc) · 1.11 KB
/
MadLibsGame.java
File metadata and controls
41 lines (23 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import java.util.Scanner;
public class MadLibsGame {
public static void main(String[] args) {
//MAD LIBS GAME
Scanner scanner = new Scanner(System.in);
String adjective1,noun1,adjective2,verb1,adjective3;
System.out.print("\nEnter an adjective (description) : ");
adjective1 = scanner.nextLine();
System.out.print("Enter a noun (animal/person) : ");
noun1 = scanner.nextLine();
System.out.print("Enter an adjective (description) : ");
adjective2 = scanner.nextLine();
System.out.print("Enter an action verb (ending with -ing) : ");
verb1 = scanner.nextLine();
System.out.print("Enter an adjective (description) : ");
adjective3 = scanner.nextLine();
System.out.println("\nToday I went to a " + adjective1 + " zoo");
System.out.println("In an exhibit , I saw a " + noun1 + ".");
System.out.println(noun1 + " was " + adjective2 + " and " + verb1 + "!" );
System.out.println("I was " + adjective3 + "!");
scanner.close();
}
}