Question: import java.util.*; public class GradeBook { private String[] names; private int[] grades; //create arrays with 100 elements public GradeBook() { } public GradeBook(int[] g, String[]

 import java.util.*; public class GradeBook { private String[] names; private int[]
import java.util.*;
 
public class GradeBook
{
 private String[] names;
 private int[] grades;
 
 //create arrays with 100 elements
 public GradeBook()
 {
 
 }
 
 
 public GradeBook(int[] g, String[] n, int num)
 {
 // **instantiate both arrays with 'num' objects
 
 //**use a for-loop to assign each name and grade with the incoming values
 
 }
 
 //**this method will find the average grade
 public double getAvg()
 {
 double avg=0.0;
 
 return avg;
 }
 
 //**this method will return the student's name with the lowest grade
 public String lowName()
 {
 String name = "";
 
 return name;
 }
 
 //**this method will return the student's name with the highest grade
 public String highName()
 {
 String name = "";
 
 return name;
 }
 
 public String toString()
 {
 String output="";
 
 return output;
 
 }
}
 
import java.util.*;
import java.io.*;
 
public class Lab07C
{
 public static void main(String[] args) throws IOException
 {
 String[] names = new String[100];
 int[] grades = new int[100];
 int count=0;
 Scanner file = new Scanner (new File("Lab07c.dat"));
 while (file.hasNext())
 {
 String line = file.nextLine();
 Scanner chopper = new Scanner (line);
 chopper.useDelimiter(",");
 String name = chopper.next();
 int grade = chopper.nextInt();
 grades[count] = grade;
 names[count] = name;
 count++; 
 }
 GradeBook g = new GradeBook(grades,names, count);
 System.out.println (g);
 }
}
 
 

Computer Science I Lab 070-Grades, revisited Lab Goal: This lab was designed to teach you how to use an array. Lab Description : highest grades. Build two arrays with student names and grades. Find out who has the lowest and Sample Data : joebob,73 greg,20 mary, 100 calvin,99 joseph,80 jose,75 marta,92 franz,56 Programs needed: Sample Output : lab07c.java lab07c.dat GradeBook.java rinnavoro The student list is: 1 joebob 73 2. greg 20 3. mary 100 4. calvin 99 5. joseph 80 6. jose 75 7 marta 92 8 franz 56 When you get the results shown, create a new dat file with your own data. Check your results. (Name your new file 'lab07c2.dat') Average = 74.375 greg has the lowest grade. mary has the highest grade

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!