Question: Java: I'm trying to get data the user selects from a menu to be saved into a course section to be tested with a try
Java: I'm trying to get data the user selects from a menu to be saved into a course section to be tested with a try catch block to verify the user hasn't enrolled in the same thing twice. Attached you'll see the pseudo code I'm working with. I've also attached an ouput for how the menu appears. I just can't figure out how to pull the data out of the menu array and assign it to the proper variable to initiate the try catch block. All help is apprecaited.

Data:

. Get information from console to instantiate your student 2. Create an array and call the getsections from your singleton to load it . DataStore dataStore DataStore.getlnstance(); .Section[] courseMenu dataStore.getSections); 3. Use a loop to show your menu: while truef for loop to display menu (this is courseMenu array or whatever you named it) ask user for input of which to enroll in if choose quit, brealk iary student addCourse (courseMenu[choice); catch Duplicate sys out Duplicate Exception getMessage() catch TooMany sys out TooMany Exception getMessage() 4. After your loop is over, print the student schedule a. Sys out student toString()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
