Add madLibs/src/Main.java
This commit is contained in:
parent
5333f9d9dd
commit
915d2e6e98
1 changed files with 34 additions and 0 deletions
34
madLibs/src/Main.java
Normal file
34
madLibs/src/Main.java
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
public class Main {
|
||||||
|
|
||||||
|
public static void main(String[] args){
|
||||||
|
|
||||||
|
Scanner scanner = new Scanner(System.in);
|
||||||
|
|
||||||
|
String adjective1;
|
||||||
|
String adjective2;
|
||||||
|
String adjective3;
|
||||||
|
String verb1;
|
||||||
|
String noun1;
|
||||||
|
|
||||||
|
System.out.print("Enter an adjective (description): ");
|
||||||
|
adjective1 = scanner.nextLine();
|
||||||
|
System.out.print("Enter a noun (animal or person): ");
|
||||||
|
noun1 = scanner.nextLine();
|
||||||
|
System.out.print("Enter an adjective (description): ");
|
||||||
|
adjective2 = scanner.nextLine();
|
||||||
|
System.out.print("Enter a verb end with -ing (action): ");
|
||||||
|
verb1 = scanner.nextLine();
|
||||||
|
System.out.print("Enter an adjective (description): ");
|
||||||
|
adjective3 = scanner.nextLine();
|
||||||
|
|
||||||
|
System.out.println("Today 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();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue