Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(use java) Create advance data types to represent University, College, Department, Student and Course. The following should be the members of these classes: Univeristy: -name

(use java) Create advance data types to represent University, College, Department, Student and Course. The following should be the members of these classes: Univeristy: -name of the university -president's name -total colleges in the university -total students in the univeristy -an array of colleges (max 10) College: -name of the college -dean's name -total departments in the college -total students in the college -an array of departments (max 20) Department: -name of the department -chair's name -total students in the department -an array of students (max 1000) Student: -name of the student -ID of the student (a unique number) -GPA of the student -an array of Courses that this student has taken or is taking (max 50) Course: -course name -grade (like A+, B, C+, etc) that a student got in this course -semester name Now, inside main(), write a test code to test the working of your class. The test code should be something like the following: (Note that from the test code, you need to understand what methods each of the above classes should have) public static void main(String[] args) { University pmu = new University("PMU", "Dr. Essa"); pmu.AddCollege("CCES", "Dr. Fadi"); pmu.AddCollege("COE", "Dr. Jamal"); pmu.AddDepartment("CCES", "IT", "Dr. Ghassen");//note that AddDepartment should be a method in College class. pmu.AddDepartment("CCES", "CE", "Dr. Loay"); pmu.AddDepartment("CCES", "CS", "Dr. Loay"); pmu.AddDepartment("CCES", "SE", "Dr. Ghassen"); pmu.AddDepartment("COE", "Mechanical", "Dr. Nezar"); pmu.AddStudent("Tariq", 201700150, "IT");//note that AddStudent should be a method in Department class. pmu.AddStudent("Ahmed", 201501110, "CS"); pmu.AddStudent("Hamza", 201645166, "Mechanical"); pmu.AddCourse(201501110, "CSI", "A+", "Spring 2016"); pmu.AddCourse(201700150, "CSII", "B+", "Fall 2017"); //now, create another university object and fill it with several students. University kfupm = new University(pmu);//copy constructor should create a new university object kfupm.SetName("KFUPM"); kfupm.SetPresentName("Dr. Ahmed"); //now add some colleges, departments, and students in kfupm object. System.out.println(pmu);//it should print the ENTIRE information nicely System.out.println(kfupm); } After creating the above classes, also write the following methods: 1)Find the name of the college which has highest number of students with A or A+ in any of their courses. pmu.FindCollegeWithHighGpaStudents(); 2)Find all the students in the entire university who have GPA>=. Note that you need to calculate each students gpa as well. pmu.FindAllStudentsWithGpa(double gpa); 3)Find which course is most popular, that is, taken by most of the students in the university. pmu.FindPopularCourse();

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

Data Management Databases And Organizations

Authors: Richard T. Watson

2nd Edition

0471180742, 978-0471180746

Students also viewed these Databases questions