-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstory.java
More file actions
22 lines (15 loc) · 778 Bytes
/
story.java
File metadata and controls
22 lines (15 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import java.util.Scanner;
public class story {
public static void main (String[] args) {
Scanner str = new Scanner(System.in);
System.out.println("I will tell you a story, but i need some information first.");
System.out.println("What is the main character called?");
String name = str.nextLine();
System.out.println("What is their job?");
String job = str.nextLine();
System.out.println("Here is the story:");
System.out.println("Once upon a time there was "+ name + " who was " + job + ".");
System.out.println("On the way to work," + name + " reflected on life.");
System.out.println("Perhaps " + name + " will not be " + job + " forever.");
}
}