-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJavaLibs5026211188.java
More file actions
78 lines (63 loc) · 3.67 KB
/
Copy pathJavaLibs5026211188.java
File metadata and controls
78 lines (63 loc) · 3.67 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import java.util.Scanner;
public class JavaLibs5026211188{
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.println("This is a story where you became an outlaw in the wild west.");
System.out.println();
System.out.println("What is your name? ");
System.out.print("(String) \t: ");
String name1 = input.next();
System.out.println();
System.out.println("If you had a horse, what do you call it?");
System.out.print("(String) \t: ");
String horseName = input.next();
System.out.println();
System.out.println("What crime did you commited?");
System.out.print("(String) \t: ");
String crime = input.next();
System.out.println();
System.out.println("How much bounty do you think you are worth? (in dollar)");
System.out.print("(Integer) \t: ");
int bountyPrice = input.nextInt();
System.out.println();
System.out.println("Enter a decimal number: ");
System.out.print("(Double) \t: ");
Double glassPrice = input.nextDouble();
System.out.println();
System.out.println("How many glass did you drink?");
System.out.print("(Integer) \t: ");
int glass = input.nextInt();
System.out.println();
input.nextLine();
double totalPrice = glassPrice * glass;
int bountyPrice2 = bountyPrice*2;
System.out.println("What is the best place to hide in the wild?");
System.out.print("(String) \t: ");
String place = input.nextLine();
System.out.println();
System.out.println("Enter a name for someone else :");
System.out.print("(String) \t: ");
String name2 = input.next();
System.out.println();
System.out.println("How many deputy are coming after you?");
System.out.print("(Integer) \t: ");
int deputy = input.nextInt();
System.out.println();
input.nextLine();
System.out.println("There was a gun fight, what do you think will happend to you? (Bad Ending)");
System.out.print("(String) \t: ");
String ending = input.nextLine();
System.out.println();
System.out.println();
System.out.println("A long time ago in the Wild West, there was an outlaw called "+name1+" and a horse called "+horseName+". ");
System.out.println("They are always together, exploring west America. "+name1+" was a wanted by the sheriff and being price at $"+bountyPrice+" for "+crime+". ");
System.out.println(name1+" went into a bar and ordered some drink. The bartender gave "+name1+" a glass of whiskey which cost $"+glassPrice+".");
System.out.println(name1+" drank "+glass+" glasses before suddenly a bounty hunter enter the bar. "+name1+" paid the bartender for $"+totalPrice+", then "+name1+" was confronted by the bounty hunter.");
System.out.println("They fought and the bounty hunter got killed. The sheriff double the bounty, making it $"+bountyPrice2+" for the price of "+name1+"'s head.");
System.out.println(name1+" was on the run and found a place to hide "+place+".");
System.out.println("After sometime, "+name1+" came out of hiding and went into town. A townfolk named "+name2+" recognized "+name1+" and alerted the sheriff.");
System.out.println("The sheriff confronted "+name1+" with the help of "+deputy+" deputy.");
System.out.println("There was a gun fight, "+name1+" was "+ending+". The sheriff gave the reward to "+name2+" for alerting the sheriff");
System.out.println("The End.");
}
}