1
+ //This java file simulates a software engineer / developer's life
1
2
package ObjectsSystem ;
2
3
import java .util .*;
4
+ import java .util .jar .Attributes .Name ;
3
5
import java .io .*;
4
6
5
7
public class Gael {
6
- String Specialization = "Programming" ;
7
- String Fear = "Insects" ;
8
+ private String Specialization = "Programming" ;
9
+ private String Fear = "Insects" ;
8
10
String Interests = "Programming, Video Games, Music, Pewdiepie" ;
9
11
short Age = 19 ;
10
12
char Gender = 'M' ;
11
- int Money ;
12
- String Agenda = "" ;
13
- String Condition = "Neutral" ;
14
- String Name ;
13
+ private int Money ;
14
+ private String Agenda = "" ;
15
+ private String Condition = "Neutral" ;
16
+ private String Name ;
17
+ private int NoteCount = 0 ;
18
+
15
19
16
20
public Gael (String name ){
17
21
Name = name ;
@@ -55,7 +59,7 @@ else if (Money >= 1000){
55
59
56
60
public void Mission (){
57
61
System .out .println ("" );
58
- System .out .println ("So much options in life! What to do?:\n a. Work\n b. Study\n c. Watch Youtube/Netflix\n d. Gamble\n e. Rest" );
62
+ System .out .println ("So much options in life! What to do?:\n a. Work\n b. Study\n c. Watch Youtube/Netflix\n d. Gamble\n e. Rest\n f. Note-Taking " );
59
63
Scanner line = new Scanner (System .in );
60
64
String choice = line .next ();
61
65
if (choice .equals ("a" )){
@@ -79,6 +83,9 @@ else if (choice.equals("d")){
79
83
else if (choice .equals ("e" )){
80
84
Rest ();
81
85
}
86
+ else if (choice .equals ("f" )){
87
+ InfiniteInput ();
88
+ }
82
89
83
90
}
84
91
@@ -213,12 +220,16 @@ public void Rest(){
213
220
System .out .println (String .format ("Money: %d \n Condition: %s\n " ,Money ,Condition ));
214
221
System .out .println ("Check the directory for the stats of your performance" );
215
222
try {
216
- FileWriter rawstats = new FileWriter ("../PersonalProjects/Java/GaelSystem.txt" );
223
+ FileWriter rawstats = new FileWriter ("../PersonalProjects/Java/ObjectsSystem/ GaelSystem.txt" );
217
224
BufferedWriter Stats = new BufferedWriter (rawstats );
218
225
Stats .write ("| GAEL SYSTEM STATS PERFORMANCE |" );
219
226
Stats .newLine ();
220
227
Stats .write (String .format ("| NAME | --> %s" ,Name ));
221
228
Stats .newLine ();
229
+ Stats .write (String .format ("| CONDITION | --> %s" ,Condition ));
230
+ Stats .newLine ();
231
+ Stats .write (String .format ("| AGE | --> %s" ,Age ));
232
+ Stats .newLine ();
222
233
Stats .write (String .format ("| CURRENT CONDITION | --> %s" ,Condition ));
223
234
Stats .newLine ();
224
235
Stats .write (String .format ("| MONEY | --> %d" ,Money ));
@@ -231,4 +242,43 @@ public void Rest(){
231
242
}
232
243
233
244
}
245
+
246
+ public void InfiniteInput (){
247
+ ArrayList <Object > NoteArray = new ArrayList <>();
248
+ System .out .println ("You will start writing your own Notes as of now! Prepare the lines" );
249
+ System .out .println (String .format ("%s's Notes" ,Name ));
250
+ Scanner LineNotes = new Scanner (System .in );
251
+ try {
252
+ FileWriter raw = new FileWriter (String .format ("../PersonalProjects/Java/ObjectsSystem/%sNotes%d.txt" ,Name ,NoteCount ));
253
+ BufferedWriter notes = new BufferedWriter (raw );
254
+ while (true ){
255
+ String newnotes = LineNotes .nextLine ();
256
+ if (newnotes .equals ("DONE" )){
257
+ System .out .println ("You have finally finished Note-taking!" );
258
+ for (int i =0 ;i <NoteArray .size ();i ++){
259
+ notes .write (String .format ("Entry %d: " ,i +1 ));
260
+ notes .write (NoteArray .get (i ).toString ());
261
+ notes .newLine ();
262
+ }
263
+ notes .flush ();
264
+ notes .close ();
265
+ raw .close ();
266
+ NoteCount ++;
267
+ for (Object i : NoteArray ){
268
+ System .out .println (i );
269
+ }
270
+ break ;
271
+ }
272
+ else {
273
+ NoteArray .add (newnotes );
274
+ }
275
+ }
276
+ Mission ();
277
+ }
278
+ catch (IOException e ){
279
+ System .out .println ("Error" );
280
+ e .printStackTrace ();
281
+ }
282
+ }
283
+
234
284
}
0 commit comments