Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can I get some help finishing the implementations in the comments of this code including the getters and setters for each class as well.. In

Can I get some help finishing the implementations in the comments of this code including the getters and setters for each class as well.. In Java please:
class Student {
private int studentId;
private ArrayList listOfCrns;
public Student(int studentId){
this.studentId = studentId;
this.listOfCrns = new ArrayList<>();
}
// Setters and getters for studentId, studentName, and gpa
public void addCourse(int crn){
listOfCrns.add(crn);
}
public void deleteCourse(int crn){
listOfCrns.remove(Integer.valueOf(crn));
}
private double calculateTotalPayment(){
// Implement the calculation based on the given formula
return 0.0; // Placeholder, replace with the actual calculation
}
public void printInvoice(){
// Implement the printing of the fee invoice based on the given format
// Use calculateTotalPayment() to get the total amount
}
}
class College {
private ArrayList list;
public College(){
this.list = new ArrayList<>();
}
public void enrollStudent(Student student){
// Implement adding a student to the list
}
public boolean searchById(int studentId){
// Implement searching for a student by id
return false; // Placeholder, replace with the actual implementation
}
public void addCourse(int studentId, int crn){
// Implement adding a course to the student's list of courses
}
public boolean deleteCourse(int studentId, int crn){
// Implement deleting a course from the student's list of courses
return false; // Placeholder, replace with the actual implementation
}
public void printInvoice(int studentId){
// Implement printing the fee invoice for the student
}
public void printSortedInvoice(int studentId){
// Implement printing the fee invoice, sorted by course number, for the student
// Do not sort the private field listOfCrns of the Student class
}

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

Step: 3

blur-text-image

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

Practical Oracle8I Building Efficient Databases

Authors: Jonathan Lewis

1st Edition

0201715848, 978-0201715842

More Books

Students also viewed these Databases questions

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago