-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMadlib.java
More file actions
33 lines (25 loc) · 1 KB
/
Madlib.java
File metadata and controls
33 lines (25 loc) · 1 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
// ******************************************
// Madlib.java Author: Maricel
// ******************************************
import java.util.Scanner;
public class Madlib
{
// -----------------------------------------------------
// Asks user for name, age college and pet's name
// Then puts into paragraph, with input
// -----------------------------------------------------
public static void main(String[] args) {
Scanner user_input = new Scanner(System.in);
String name, college, pet_name;
int age;
System.out.println("What is your name? ");
name = user_input.next();
System.out.println("How old are you? ");
age = user_input.nextInt();
System.out.println("What is your dream college? ");
college = user_input.next();
System.out.println("What is your pet's name? ");
pet_name = user_input.next();
System.out.println("Hello, my name is " + name + " and I am " + age + " years\nold." + "I'm enjoying my time at " + college + ", though\nI miss my pet " + pet_name + " very much!");
}
}