Make a program that manages the student information 1. Make a class for Student and a...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Make a program that manages the student information 1. Make a class for "Student" and a class "Course" Student Integer sid; - String sname; - ArrayList<Course> clist; - - - String cid; String cname; Integer credit; String grade; Course + Student (int id, String name, ArrayList<Course> ); + 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<Course>) • Constructor • Student (int id, String name, ArrayList<Course> ) 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<Student> fillupStudent() In this method, read all user data below and then construct the list of student objects return the ArrayList<Student> 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<Student>) Print all students information public static void printStudent (ArrayList<Student>, Integer id) Print the student information with the "id" public static findStudent (ArrayList<Student>) 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<Course> clist; Student (Integer id, String name, ArrayList<Course> 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<Student> fillupStudent() { } ArrayList<Student> slist = new ArrayList<Student>(); // Your Code return slist; public static void printStudent (ArrayList<Student> slist) { } // Your code public static void printStudent (ArrayList<Student> slist, Integer id) { // Your code } public static Integer findStudent (ArrayList<Student> slist) { } // Your code public static void main(String[] args) { Integer sid; ArrayList<Student> slist; slist fillupStudent(); printStudent (slist); sid = findStudent (slist); printStudent (slist, sid); } } Make a program that manages the student information 1. Make a class for "Student" and a class "Course" Student Integer sid; - String sname; - ArrayList<Course> clist; - - - String cid; String cname; Integer credit; String grade; Course + Student (int id, String name, ArrayList<Course> ); + 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<Course>) • Constructor • Student (int id, String name, ArrayList<Course> ) 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<Student> fillupStudent() In this method, read all user data below and then construct the list of student objects return the ArrayList<Student> 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<Student>) Print all students information public static void printStudent (ArrayList<Student>, Integer id) Print the student information with the "id" public static findStudent (ArrayList<Student>) 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<Course> clist; Student (Integer id, String name, ArrayList<Course> 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<Student> fillupStudent() { } ArrayList<Student> slist = new ArrayList<Student>(); // Your Code return slist; public static void printStudent (ArrayList<Student> slist) { } // Your code public static void printStudent (ArrayList<Student> slist, Integer id) { // Your code } public static Integer findStudent (ArrayList<Student> slist) { } // Your code public static void main(String[] args) { Integer sid; ArrayList<Student> slist; slist fillupStudent(); printStudent (slist); sid = findStudent (slist); printStudent (slist, sid); } }
Expert Answer:
Answer rating: 100% (QA)
Heres a Java program implementing the Student and Course classes according to the provided specifications import javautilArrayList public class Studen... View the full answer
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these programming questions
-
Blocks a, b, and c in FIGURE Q14.7 have the same volume. Rank in order, from largest to smallest, the sizes of the buoyant forces F a , F b , and F c on a, b, and c. Explain. 50 g 40 g 50 g
-
Blocks a, b, and c in FIGURE Q14.7 have the same density. Rank in order, from largest to smallest, the sizes of the buoyant forces F a , F b , and F c on a, b, and c. Explain. 50 g 40 g 50 g
-
The number of hours of daylight that occur at any location on Earth depends on the time of year and the latitude of the location. The equations below model the numbers of hours of daylight in Seward,...
-
The trial balance of Hoi Inc. includes the statement of financial position accounts listed below. Identify the accounts that might require adjustment. For each account that requires adjustment,...
-
In Exercises 3950, graph the given functions, f and g, in the same rectangular coordinate system. Select integers for x, starting with -2 and ending with 2. Once you have obtained your graphs,...
-
After the positrons were annihilated, the energy density of the universe was dominated by the photons and the neutrinos. Show that the energy density in that era was given by \(u_{\text {total...
-
Pace Distributing Company completed the following merchandising transactions in the month of April. At the beginning of April, the ledger of Pace showed Cash of $9,000 and Owners Capital of $9,000....
-
Two large parallel plates are separated by a 0.015-m gap. The plates are connected to the terminals of a 12-V battery, which remains connected. a) What is the strength of the electric field in the...
-
Proposed change/idea Where actions will take place The sequence of events will take to make change Here are some ideas of what you can create/make: Write a letter and send it to the local newspaper,...
-
Based on the following information use a two-stage growth model to estimate the XYZ Corporation's stock price. The most recent dividend $ 2.70 Investor's required rate of return 13.0% Expected...
-
What tax rate is applied on Juliana's Strongsville income tax return?
-
Exactly five years from today, Prisha would like to buy an entertainment system with cash. Prisha currently has $750 saved in an investment account that pays interest of 4.75% p.a., but with monthly...
-
A Treasury bill has a face value of 100K, 177 days to maturity, and is selling for $98 thousand. What is the effective annual yield on this bill? Enter answer in percents, accurate to two decimal...
-
For the 11-bit binary string 01001100011: a) Find the number of transitions for the encoding schemes Manchester & Differential Manchester b) If the above combination rate is 10Mbps, calculate the...
-
Assume that a contact has a valid offer, acceptance, and consideration, write a research paper explaining other requirements for a contact to be valid and enforceable. For example, when must a...
-
Which of the following raises the credibility of areport? Which of the following raises the credibility of a report? Multiple Choice avoiding predictions avoiding the use of cause-effect statements...
-
Suppose that we would like to perform a bird survey to count the number of birds of each species in an area. Create a class BirdSurvey that is like one of the linked-list classes given in this...
-
Suppose that we want to compute the geometric mean of a list of positive values. To compute the geometric mean of k values, multiply them all together and then compute the kth root of the value. For...
-
Modify the class LapTimer, as described in Exercise 13 of Chapter 9, as follows: Add an attribute for a file stream to which we can write the times Add a constructor LapTimer(n, person, fileName) for...
-
What is likely to be the impact of rising levels of intra-regional trade for the world economy?
-
Why doesnt the USA specialise as much as General Motors or Texaco? Why doesnt the UK specialise as much as Unilever? Is the answer to these questions similar to the answer to the questions, Why...
-
It is often argued that if the market fails to develop infant industries, then this is an argument for government intervention, but not necessarily in the form of restricting imports. In what other...
Study smarter with the SolutionInn App