Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Student.java (DONE) public class Student { private int stuIdNum; // 6-digits private double stuGpa; /** * Default constructor */ public Student() { } /** *

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Student.java (DONE)

public class Student { private int stuIdNum; // 6-digits private double stuGpa;

/** * Default constructor */ public Student() { }

/** * Constructor with parameters * * @param stuIdNum * @param stuGpa */ public Student(int stuIdNum, double stuGpa) { this.stuIdNum = stuIdNum; this.stuGpa = stuGpa; }

/** * Getter * * @return stuGpa */ public double getStuGpa() { return stuGpa; }

/** * Setter * * @param stuGpa */ public void setStuGpa(double stuGpa) { this.stuGpa = stuGpa; }

/** * Getter * * @return stuIdNum */ public int getStuIdNum() { return stuIdNum; }

/** * Setter * * @param stuIdNum */ public void setStuIdNum(int stuIdNum) { this.stuIdNum = stuIdNum; } }

StudentList.java

mport java.io.*; import java.util.ArrayList; import java.util.Scanner;

public class StudentList { private String courseNum; private ArrayList stuList; // list of students

/** * Constructor */ public StudentList(String courseNum) { this.courseNum = courseNum; stuList = new ArrayList (); } /** * getter * @return courseNum */ public String getCourseNum() { return courseNum; }

/** * setter * @param courseNum */ public void setCourseNum(String courseNum) { this.courseNum = courseNum; }

/** * Method to read data from file courseNum.txt * Each line of the file will contain a student id number and student gpa * separated by a space. Sample file lines: * 111111 3.1 * 222222 3.82 * The method will create a Student object from each line of data, * and place the object into the stuList ArrayList. * Thrown exceptions are handled by the caller * * @throws IOException automatically, when input file cannot be opened * @return FIX */ public int readStudentDataFile() throws IOException { // FIX for Tests 1 - 3 return 0; }

/** * Method to display student id numbers and student GPAs * for each student in studentArray */ public void displayStudentList() { // FIX for Tests 5 & 6 } /** * Method to add one student to the stuList ArrayList * * @param FIX * @param FIX */ public void addStudent() { // FIX for Tests 7 & 8 }

/** * Method to change one student's GPA * * @param FIX * @param FIX */ public void changeStudentGpa() { // FIX for Tests 9 - 11 } /** * Method to display students with the highest GPA */ public void showHighestGpaStudents() { // FIX for Tests 12 - 14 } /** * Method to save the data from stuList ArrayList to an update file * (IOExceptions handled within the method) * Each line of the file will contain a student number and a student GPA, * separated by a space. Sample file lines: * 111111 3.1 * 222222 3.82 */ public void writeUpdatedFile() { // FIX for Tests 15 & 16 }

/** * getter - FOR TESTING USE ONLY -- STUDENTS SHOULD NOT CALL THIS METHOD IN THEIR PROGRAMS * @return ArrayList of students */ public ArrayList getStuList() { return stuList; } }

StudentListManager.java

import java.io.IOException; import java.util.Scanner;

public class StudentListManager {

/** * @param args the command line arguments */ public static void main(String[] args) { char choice = '?'; int stuId; double gpa; Scanner keyboard = new Scanner(System.in); System.out.println("Enter course number:"); String courseNum = keyboard.next(); StudentList students = new StudentList(courseNum); // FIX for ALL tests } /** * Method displays menu to user * Reads, uppercases, validates, and returns choice from menu * * @param FIX * @return FIX */ public static char FIXname() { // FIX for Test 4 return 'X'; // } }

This program will store information for students registered for one course. Each student has a 6-digit id number and a GPA. The student list is stored in a data file, with one line of data for each student Test Data Files (included in the zyLab) CS100.txt 123456 3.46 334455 2.7 CS210.txt 444444 4.0 555555 3.55 222222 2.22 333333 3.3 This program will store information for students registered for one course. Each student has a 6-digit id number and a GPA. The student list is stored in a data file, with one line of data for each student Test Data Files (included in the zyLab) CS100.txt 123456 3.46 334455 2.7 CS210.txt 444444 4.0 555555 3.55 222222 2.22 333333 3.3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions

Question

What is the difference between equity funding and debt financing?

Answered: 1 week ago