In Java Write a program which should be able to store 2 quiz scores for a maximum of 5 students. Your program should declare 3 arrays to store names and two scores for each of the students. Your program should declare methods to add, delete, update information for students. Your program should also allow to print the list of all students with their scores and also it should allow to print students whose average is less than 5. Your main function should have all theses options in a loop. (Hint: For Delete, just set the name to null. While printing, print the values only when name is not null). You need to pass arrays and student data to your functions. Following is a sample run: 1: Add a student record2: Delete a student record3: Update a student record4: Print all student records5: Print all student records who average of quiz is below 5. Enter a number: 1Enter name:JohnEnter Quiz 1 Score :9Enter Quiz 2 Score:10Student Successfully added 1: Add a student record2: Delete a student record3: Update a student record4: Print all student records5: Print all student records who average of quiz is below 5. Enter a number: 2 Enter name:EthanStudent Successfully deleted 1: Add a student record2: Delete a student record3: Update a student record4: Print all student records5: Print all student records who average of quiz is below 5. Enter a number: 3Enter name:EdwardEnter Quiz 1 Score :8Enter Quiz 2 Score:7Student Successfully updated 1: Add a student record2: Delete a student record3: Update a student record4: Print all student records5: Print all student records who average of quiz is below 5. Enter a number: 4 Name Quiz1 Quiz2---- ----- ----- -------John 9 10Peter 8 2Rose 9 9Edward 7 5Ethan 8 6 1: Add a student record2: Delete a student record3: Update a student record4: Print all student records5: Print all student records who average of quiz is below 5. Enter a number: 5 Name Quiz1 Quiz2---- ----- -----
In Java Write a program which should be able to store 2 quiz scores for a maximum of 5 students. Your program should declare 3 arrays to store names and two scores for each of the students. Your program should declare methods to add, delete, update information for students. Your program should also allow to print the list of all students with their scores and also it should allow to print students whose average is less than 5. Your main function should have all theses options in a loop. (Hint: For Delete, just set the name to null. While printing, print the values only when name is not null). You need to pass arrays and student data to your functions.
Following is a sample run:
1: Add a student record
2: Delete a student record
3: Update a student record
4: Print all student records
5: Print all student records who average of quiz is below 5.
Enter a number: 1
Enter name:
John
Enter Quiz 1 Score :
9
Enter Quiz 2 Score:
10
Student Successfully added
1: Add a student record
2: Delete a student record
3: Update a student record
4: Print all student records
5: Print all student records who average of quiz is below 5.
Enter a number: 2
Enter name:
Ethan
Student Successfully deleted
1: Add a student record
2: Delete a student record
3: Update a student record
4: Print all student records
5: Print all student records who average of quiz is below 5.
Enter a number: 3
Enter name:
Edward
Enter Quiz 1 Score :
8
Enter Quiz 2 Score:
7
Student Successfully updated
1: Add a student record
2: Delete a student record
3: Update a student record
4: Print all student records
5: Print all student records who average of quiz is below 5.
Enter a number: 4
Name Quiz1 Quiz2
---- ----- ----- -------
John 9 10
Peter 8 2
Rose 9 9
Edward 7 5
Ethan 8 6
1: Add a student record
2: Delete a student record
3: Update a student record
4: Print all student records
5: Print all student records who average of quiz is below 5.
Enter a number: 5
Name Quiz1 Quiz2
---- ----- -----
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 4 images