*Summary is based on the grades with 75 and above as the passing grade.

computer science

Description

The professor want us to create a menu in java class wherein a user will pick 1-4 choices and it is an endless loop when you run the program. The professor provided a scenario where the user picks 1 of the 4 choices and the following output display or responses must be followed.


New Project > Java Application *tick on the “Create Main Class” > Project Name: FPCP1

This will be done in java class not in Form.

EDIT SCENARIO:

MENU

1-Edit

2-Delete

3-Display

4-Search

Enter Choice [1,2,3,4]: 1


Please enter record no to edit: 3

Enter name: Marilyn

Enter Grade: 100


Do you want to save the changes? [y-yes/n-no]: y

Record updated successfully


MENU

1-Edit

2-Delete

3-Display

4-Search

Enter Choice [1,2,3,4]: 


WHAT IF USER ENTERS n for NO SCENARIO?


MENU

1-Edit

2-Delete

3-Display

4-Search

Enter Choice [1,2,3,4]: 1 


Please enter record no to edit: 3

Enter name: Marilyn

Enter Grade: 100


Do you want to save the changes? [y-yes/n-no]: n

Edit cancelled.


MENU

1-Edit

2-Delete

3-Display

4-Search

Enter Choice [1,2,3,4]: 




WHAT IF USER ENTERS RECORD NO. OUT OF RANGE SCENARIO?


MENU

1-Edit

2-Delete

3-Display

4-Search

Enter Choice [1,2,3,4]: 1


Please enter record no to edit: 100

Invalid record number. Please enter record no between 1-5 only. Please try again.


MENU

1-Edit

2-Delete

3-Display

4-Search

Enter Choice [1,2,3,4]: 


**********************************************************


DELETE SCENARIO:

MENU

1-Edit

2-Delete

3-Display

4-Search

Enter Choice [1,2,3,4]: 2


Please enter record no to delete: 3

Record deleted successfully.


MENU

1-Edit

2-Delete

3-Display

4-Search

Enter Choice [1,2,3,4]: 





NOTE: for deleting the record, just replace the data with empty string.

Ex. Student[2][0]=””;

      Student[2][1]=””;



SEARCH SCENARIO:

MENU

1-Edit

2-Delete

3-Display

4-Search

Enter Choice [1,2,3,4]: 4


Enter name to search: Alex

Alex found at row 1


MENU

1-Edit

2-Delete

3-Display

4-Search

Enter Choice [1,2,3,4]: 


WHAT IF NO NAME FOUND SCENARIO:


MENU

1-Edit

2-Delete

3-Display

4-Search

Enter Choice [1,2,3,4]: 4


Enter name to search: Alexander

Alexander not found. Please try again


MENU

1-Edit

2-Delete

3-Display

4-Search

Enter Choice [1,2,3,4]: 




DISPLAY SCENARIO:

MENU

1-Edit

2-Delete

3-Display

4-Search

Enter Choice [1,2,3,4]: 3


No. Name Grade Remarks

1 Alex 80 Passed

2 John 90 Passed

3 Mel 83 Passed

4 James 50 Failed

5 Paul 48 Failed


Summary:

Passed-3

Failed-2


*Summary is based on the grades with 75 and above as the passing grade. 


MENU

1-Edit

2-Delete

3-Display

4-Search

Enter Choice [1,2,3,4]: 



Instruction Files

Related Questions in computer science category