1
1
package com .codedifferently .projectoop .decode .decodelifeapp ;
2
2
3
+
3
4
import java .util .ArrayList ;
4
- import java .util .Scanner ;
5
-
6
- public class EventCollection {
7
- Scanner input = new Scanner (System .in );
8
- ArrayList <String > events = new ArrayList <>();
9
-
10
- public void addEvent (String event ) {
11
- events .add ("Conference" );
12
- events .add ("Job fair" );
13
- events .add ("Hackathon" );
14
- events .add ("Networking Social" );
15
- events .add ("Bootcamp Program Applications" );
16
- events .add ("Pitch Competitions" );
17
- events .add ("Internship Applications" );
18
- events .add ("Mentorship Programs" );
19
- events .add ("Webinars" );
20
- events .add ("Study Hall Session" );
21
- events .add ("Tech Talks" );
22
- }
23
-
24
- public void removeEvent (String event ) {
25
- events .remove (event );
26
- }
27
-
28
- public void displayEvents () {
29
- System .out .println ("Upcoming Tech Events:" );
30
- for (int i = 0 ; i < events .size (); ++i ) {
31
- System .out .println ((i + 1 ) + ". " + events .get (i ));
32
- }
33
- }
34
-
35
- //Method that will allow users that login with the role of mentor to add events
36
- //This should go inside of the events folder.
37
-
38
-
39
- }
5
+ import java .util .HashMap ;
6
+ import java .util .Map ;
7
+
8
+
9
+ public class EventCollection extends Object {
10
+ public ArrayList <String > eventNames = new ArrayList <>();
11
+ public ArrayList <String > eventDates = new ArrayList <>();
12
+ public ArrayList <String > eventLocations = new ArrayList <>();
13
+ public ArrayList <String > eventDescriptions = new ArrayList <>();
14
+
15
+
16
+ private Map <String , String > eventDescriptionMap ;
17
+
18
+
19
+ public EventCollection () {
20
+ eventDescriptionMap = new HashMap <>();
21
+ initializeEventDescriptions ();
22
+ }
23
+
24
+
25
+ // Initialize event names and their corresponding descriptions
26
+ private void initializeEventDescriptions () {
27
+ eventDescriptionMap .put ("Conference" , "Network with industry leaders and fellow tech enthusiasts." );
28
+ eventDescriptionMap .put ("Job fair" , "Bring your resume and meet potential employers." );
29
+ eventDescriptionMap .put ("Hackathon" , "Collaborate in real-time to build awesome projects." );
30
+ eventDescriptionMap .put ("Networking Social" , "Get insights from tech veterans and grow your skills." );
31
+ eventDescriptionMap .put ("Bootcamp Program Applications" , "Learn how to pitch your ideas to real investors." );
32
+ eventDescriptionMap .put ("Pitch Competitions" , "Hands-on experience with the latest technologies." );
33
+ eventDescriptionMap .put ("Internship Applications" , "Live Q&A with developers from top tech companies." );
34
+ eventDescriptionMap .put ("Mentorship Programs" , "Apply your skills in real-world scenarios." );
35
+ eventDescriptionMap .put ("Webinars" , "Build connections that will last beyond the event." );
36
+ eventDescriptionMap .put ("Study Hall Session" , "Discover new tools and frameworks from experts." );
37
+ eventDescriptionMap .put ("Tech Talks" , "Explore industry trends and deepen your technical expertise." );
38
+ }
39
+
40
+
41
+ public void addDefaultEvents () {
42
+ addEvent ("Conference" , "2025-07-15" , "Tech Center" );
43
+ addEvent ("Job fair" , "2025-08-01" , "Downtown Hub" );
44
+ addEvent ("Hackathon" , "2025-06-20" , "Innovation Lab" );
45
+ addEvent ("Networking Social" , "2025-09-05" , "Skyline Lounge" );
46
+ addEvent ("Bootcamp Program Applications" , "2025-05-10" , "Online" );
47
+ addEvent ("Pitch Competitions" , "2025-07-22" , "Venture Hall" );
48
+ addEvent ("Internship Applications" , "2025-04-30" , "Online Portal" );
49
+ addEvent ("Mentorship Programs" , "2025-06-01" , "Community Center" );
50
+ addEvent ("Webinars" , "2025-05-20" , "Virtual" );
51
+ addEvent ("Study Hall Session" , "2025-04-25" , "Library Room B" );
52
+ addEvent ("Tech Talks" , "2025-07-12" , "Tech Auditorium" );
53
+ }
54
+
55
+
56
+ public void addEvent (String name , String date , String location ) {
57
+ eventNames .add (name );
58
+ eventDates .add (date );
59
+ eventLocations .add (location );
60
+ eventDescriptions .add (generateDescriptionForEvent (name ));
61
+ }
62
+
63
+
64
+ public void removeEvent (String name ) {
65
+ int index = eventNames .indexOf (name );
66
+ if (index != -1 ) {
67
+ eventNames .remove (index );
68
+ eventDates .remove (index );
69
+ eventLocations .remove (index );
70
+ eventDescriptions .remove (index );
71
+ }
72
+ }
73
+
74
+
75
+ public void displayEvents () {
76
+ System .out .println ("📅 Upcoming Tech Events:" );
77
+ for (int i = 0 ; i < eventNames .size (); i ++) {
78
+ System .out .println ((i + 1 ) + ". " + eventNames .get (i ));
79
+ System .out .println (" Date: " + eventDates .get (i ));
80
+ System .out .println (" Location: " + eventLocations .get (i ));
81
+ System .out .println (" Description: " + eventDescriptions .get (i ));
82
+ System .out .println ();
83
+ }
84
+ }
85
+ private String generateDescriptionForEvent (String name ) {
86
+ return eventDescriptionMap .getOrDefault (name , "No description available." );
87
+ }
88
+
89
+
90
+ // Getters for testing
91
+ public ArrayList <String > getEventNames () { return eventNames ; }
92
+ public ArrayList <String > getEventDates () { return eventDates ; }
93
+ public ArrayList <String > getEventLocations () { return eventLocations ; }
94
+ public ArrayList <String > getEventDescriptions () { return eventDescriptions ; }
95
+ }
96
+
97
+
98
+
0 commit comments