-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLanguage.java
165 lines (136 loc) · 4.83 KB
/
Language.java
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
/*
* **********************************************
* San Francisco State University
* CSC 220 - Data Structures
* File Name: Language.java
* @author: Duc Ta
* @author: Bryan Khor
* **********************************************
*/
package CSC220ASMT2;
import java.util.Scanner;
public final class Language {
//
// Static Data Fields
//
private static final String defaultAlienSound = "~ ąļīæń ~ "; // Default
//
// Instance Data Fields
//
//
// Constructors
//
public Language() {
}
public Language(String language) {
switch (language.toLowerCase()) {
case "alien" -> this.populateAlienPhrases(); // Supported
case "chinese" -> this.populateChinesePhrases(); // Future implementation
case "french" -> this.populateFrenchPhrases(); // Future implementation
case "spanish" -> this.populateSpanishPhrases(); // Future implementation
case "future" -> this.populateYourLanguagePhrases(); // Future implementation
default -> this.populateEnglishPhrases(); // Supported
}
}
private static Scanner input = new Scanner(System.in);
private static String languageChoice;
private static String timeZone;
public static void displayAppHeader() {
System.out.println("-".repeat(70) + "\n" + "-".repeat(22) +
" SF GIANTS THANK YOU " + "-".repeat(27) + "\n" + "-".repeat(70) + "\n" +
" ".repeat(44) + " powered by CSC 220 @ SFSU ");
System.out.print("Language: ");
String language = input.next();
setLanguageChoice(language);
while (!language.equals("English") || !language.equals("Chinese") || !language.equals("French") || !language.equals("Spanish") || !language.equals("Alien")) {
if (language.equals("English") || language.equals("Chinese") || language.equals("French") || language.equals("Spanish") || language.equals("Alien")) {
break;
}
System.out.println("Language: UNSUPPORTED language. Please enter your language.");
System.out.println("Language: English, Chinese, French, Spanish, Alien");
System.out.print("Language: ");
language = input.next();
setLanguageChoice(language);
}
System.out.print("Time zone: ");
String timeZone = input.next() + input.nextLine();
setTimeZone(timeZone);
while (!timeZone.equals("PST") || !timeZone.equals("CST") || !timeZone.equals("EST")) {
if (timeZone.equals("PST") || timeZone.equals("CST") || timeZone.equals("EST")) {
break;
}
System.out.println("Time zone: " + timeZone);
System.out.println("Time Zone: INVALID time zone. Please enter your time zone.");
System.out.print("Time zone: ");
timeZone = input.next() + input.nextLine();
setTimeZone(timeZone);
}
}
public static Language setLanguagePreference() {
Language languagePreference = new Language(Language.getLanguageChoice());
return languagePreference;
}
private void populateEnglishPhrases() {
}
private void populateYourLanguagePhrases() {
}
private void populateSpanishPhrases() {
}
private void populateFrenchPhrases() {
}
private void populateChinesePhrases() {
}
private void populateAlienPhrases() {
}
public Object getLanguage() {
return "English";
}
public Object getUniversityPhrase(int i) {
return "San Francisco State University";
}
public Object getClubPhrase(int i) {
return "San Francisco Giants";
}
public String getConfigPhrase(int i) {
String phrase = "";
switch(i) {
case 0 -> phrase = "-".repeat(75);
case 1 -> phrase = "Language: ";
case 2 -> phrase = "Time Zone: ";
case 3 -> phrase = "Color Sequences: ";
case 4 -> phrase = "Standard Output Log: ";
case 5 -> phrase = "Standard Error Log: ";
case 6 -> phrase = "Receipt Log: ";
case 7 -> phrase = "Default University: ";
case 8 -> phrase = "Default Club: ";
}
return phrase;
}
public String getGreetingPhrase(int i) {
return "test";
}
//
// Static Methods
//
//
// Additional Static Methods
//
//
// Instance Methods
//
public static String getLanguageChoice() {
return languageChoice;
}
public static void setLanguageChoice(String languageChoice) {
Language.languageChoice = languageChoice;
}
public static String getTimeZone() {
return timeZone;
}
public static void setTimeZone(String timeZone) {
Language.timeZone = timeZone;
}
//
// Language
//
}