Please show me how to code this using Java : NOTE: ALL STEPS 1-6 NEED TO BE INCO
ID: 3759392 • Letter: P
Question
Please show me how to code this using Java :
NOTE: ALL STEPS 1-6 NEED TO BE INCORPORATED INTO ONE PROGRAM
Create a program to enter grades and calculate averages and letter grades.
1. Need a class which will contain:
Student Name
Student Id
Student Grades (an array of 3 grades)
A constructor that clears the student data (use -1 for unset grades)
Get functions for items a, b, and c, average, and letter grade
Set functions for items a, n, and c
Note that the get and set functions for Student grades need an argument for the grade index.
2. Need another class which will contain:
An Array of Students (1 above)
A count of number of students in use
3. You need to create a menu interface that allows you to:
Add new students
Enter test grades
Display all the students with their names, ids, test grades, average, and letter grade
Exit the program
4. Add comments and use proper indentation.
5. The system should be able to accept a student with no grades, then later add one or more grades, and when all grades are entered, calculate the final average or grade.
6. The system should also be able to display the students in alphabetical order (no matter what order they are entered in)
An example menu might be:
Enter A to Add Students
Enter B to Enter Test Grades
Enter C to Display Results
Enter D to Exit Program
Please select A, B, C, or D:
For item B, you will need to prompt the user to enter the test number and then enter the value for each student for that test (if there is a previous value, you should display it and if the user enters the empty string, not change the value).
Explanation / Answer
package practicals; import java.util.Scanner; public class GradeSystem { public static void main(String[] args) { // variable declaration String name; int mark1, mark2, mark3, mark4; int grade = 0; int A, B, C, D, F; double average; // input Scanner input = new Scanner(System.in); System.out.println("Enter Your Name"); name = input.nextLine(); Scanner number = new Scanner(System.in); System.out.println("Enter Your Registration Number"); name = input.nextLine(); Scanner marks = new Scanner(System.in); System.out.println("Enter The Student Marks from The Four Subjects"); mark1 = input.nextInt(); mark2 = input.nextInt(); mark3 = input.nextInt(); mark4 = input.nextInt(); input.close(); average = (double) (mark1 + mark2 + mark3 + mark4) / 4; System.out.println("Your average from last semester is " + average); if (grade >= 80 && grade = 70 && grade = 60 && grade = 50 && grade = 40 && grade = 0 && gradeRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.