Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Make a program that manages the student information 1. Make a class for Student and a class Course Student Integer sid; - String sname;
Make a program that manages the student information 1. Make a class for "Student" and a class "Course" Student Integer sid; - String sname; - ArrayList clist; - - - String cid; String cname; Integer credit; String grade; Course + Student (int id, String name, ArrayList ); + public Integer getTotalCredits(); + public String toString(); + Course(String id, String name, Integer c, String g) + public String toString(); Class Object Instances Example 1001 John Course 1002 CIS01 C++ 5 CIS02 Python CIS231 Java 3 3 A+ AO 3 A+ Kurt Course CIS01 CIS02 CIS232 CNT02 C++ Python Java2 Cisco 3 3 3 3 A+ AO A+ A+ 1003 Kim Course CIS01 C++ CIS232 Java2 3 A+ A+ The Class Student The Class Student has the properties sid (Integer), name(String), and clist(ArrayList ) Constructor Student (int id, String name, ArrayList ) There are two methods in the Class Student public Integer getTotal Credits(); // return the total credits of the courses public String toString(); // Override the toString() to print the object instance // Return the string to print all information of the Student object The Class Course The Class Course has the properties cid(String), cname(String), credit (Integer), and grade(String) Constructor Course(String id, String name, Integer c, String g) There are two methods in the Class Student public String toString(); // Override the toString() to print the object instance // Return the string to print all information of the Course object public static ArrayList fillupStudent() In this method, read all user data below and then construct the list of student objects return the ArrayList 1001 John CISO1 C++ CISO2 Python CIS231 Java 1002 Kurt CISO1 C++ CISO2 Python 3 AO CIS232 Java2 333 mm A+ ** AO A+ AO A+ CNTO2 Cisco 3 AO 1003 Kim CISO1 C++ CIS232 Java2 3 AO 3 A+ public static void printStudent (ArrayList ) Print all students information public static void printStudent (ArrayList , Integer id) Print the student information with the "id" public static findStudent (ArrayList ) Return the student ID who has the greatest total credits // Course.java public class Course { String cid; String cname; } Integer credit; grade; String Course (String id, String name, Integer c, String g) { } // Your code public String toString() { } // Your code // Overide the toString() to print the course object public class Student { Integer sid; String sname; ArrayList clist; Student (Integer id, String name, ArrayList c) { } sid = id; sname name; clist = c; public String toString() { } // Your code to print Student Object public Integer getTotalCredits() { // Your code // to get the total credits for a student object } } public class { public static ArrayList fillupStudent() { } ArrayList slist = new ArrayList (); // Your Code return slist; public static void printStudent (ArrayList slist) { } // Your code public static void printStudent (ArrayList slist, Integer id) { // Your code } public static Integer findStudent (ArrayList slist) { } // Your code public static void main(String[] args) { Integer sid; ArrayList slist; slist fillupStudent(); printStudent (slist); sid = findStudent (slist); printStudent (slist, sid); } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Heres a Java program implementing the Student and Course classes according to the provided specifications import javautilArrayList public class Studen...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started