-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain Menu.txt
More file actions
76 lines (54 loc) · 1.16 KB
/
Main Menu.txt
File metadata and controls
76 lines (54 loc) · 1.16 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
/**
* Creates Numbers and Strings Menu.
*
*/
public class NumbersMenu {
private String menuText;
private int optionCount;
/**
* Constructs a new Menu.
*
*
*/
public NumbersMenu(){
menuText = "";
optionCount = 0;
}
/**
* Write the option that you want on the menu.
* @param String you want to be shown in screen.
*
*/
public void addOption(String option){
optionCount++;
menuText = menuText + " " + optionCount +">"+ " " + option + "\n";
}
/**
* Creates a header for the menu with the add header method.
* @param string to be shown on top of the menu
*
*/
public void addHeader(String head){
menuText = head + "\n";
}
/**
* Creates a new menu with the add option method.
* @param the three strings to be shown for the user to select.
*
*/
public NumbersMenu (String d, String a, String b , String c){
menuText = "";
addHeader(d);
addOption(a);
addOption(b);
addOption(c);
}
/**
* Displays the menu created.
*
*/
public void display()
{
System.out.println("\n" + menuText);
}
}