-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDonaldBoat.java
More file actions
61 lines (57 loc) · 1.53 KB
/
DonaldBoat.java
File metadata and controls
61 lines (57 loc) · 1.53 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
import java.util.Scanner;
public class DonaldBoat
{
public static void main()
{
while(true)
{
System.out.println("Welcome to Donald's Boat!");
Scanner myScanner = new Scanner(System.in);
System.out.println("Where would you like to go?");
System.out.println(" ");
System.out.println("Below Deck");
System.out.print("The Ship's Wheel");
System.out.println(" ");
System.out.println("Captain's Quarters");
System.out.println(" ");
System.out.println("Type 'Exit' to leave Donald's Boat.");
String destination = myScanner.nextLine();
if (destination .equals("Below Deck"))
{
System.out.println(goBelowDeck());
System.out.println(" ");
}
else if (destination .equals("The Ship's Wheel"))
{
System.out.println(theShipWheel());
System.out.println(" ");
}
else if (destination .equals("Captain's Quarters"))
{
System.out.println(captainQuarters());
System.out.println(" ");
}
else if (destination .equals("Exit"))
{
System.out.println(leave());
break;
}
}
}
public static String goBelowDeck()
{
return ("You shot a cannon. Congratulations!!! You shot a ship down!");
}
public static String theShipWheel()
{
return ("You just made the ship move into a new direction. Look at you. You are the captain now!");
}
public static String captainQuarters()
{
return ("Look at all that bounty the captain has!!!");
}
public static String leave()
{
return ("Than you for visiting Donald's Boat. We hope to see you again!");
}
}