I\'m just trying to figure out how to start creating this program or at least an
ID: 3566761 • Letter: I
Question
I'm just trying to figure out how to start creating this program or at least an idea.
You are going to create a class grades info system with at most 15 grades capacity. In your program you have 6 functions. Add grades to class, Remove grades, Print grades, Sort grades, Find Max/Min grades and Calculate average. To make debugging your program easier, enter the first four grades of the class inside your program, so every time you run the program you will have at least four records ready.
To solve this problem you need to declare 6 functions:
addGrade, removeGrade, printGrade, sortGrade,
findMinMax, calcAverage. In your main function you need to
declare grades array with size 15 and initialize it with at least
four grades also you need to have a variable to keep the
number of grades initially 4. Then for every function you need to pass grades array and number to them. And as you see, inside
your sort function, you need to call your print function to print the list of the grades after sorting.
Thank you in Advance
Explanation / Answer
import java.lang.String; import java.util.*; public class System { public static void main(String[] args){ /*-- Declaration of variable --*/ Scanner s = new Scanner(System.in); int maxSize = 20; int[] grades = new int [maxSize]; String [] students = new String[maxSize]; int front=0; int rear=-1; int nItems=0; int count=1; int i=0; int num=0, j=0, average=0, total=0; Queue(); f first = null; last = null; /*-- While loop to get the names and grades entered --*/ while (count!=-1) { count ++; System.out.println("Enter the students name"); students [i] = input.next(); System.out.println("Enter the students grades"); grades[i] = input.nextInt(); /*-- print student information and average --*/ } for(i = 0; iRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.