Question: Exercise We will create a few classes to represent a college system. A college has students registered with them. Each student has attributes of a

 Exercise We will create a few classes to represent a college
system. A college has students registered with them. Each student has attributes
of a person (first name, last name, email, and phone number) and

Exercise We will create a few classes to represent a college system. A college has students registered with them. Each student has attributes of a person (first name, last name, email, and phone number) and a gpa, which is calculated based on the marks obtained in various courses (number of courses can vary). We will then add faculty also to the system. More classes and properties will be added later. As the first step, you need to create the following classes: Person class Instance variables (private): firstName(String), lastName (String), emailid (String), phoneNumber (long) Constructor: parameterized constructor that gets values to set all properties of a person Methods: getters to return name, email ID and phone number. Name should be returned as one string. If first name is "John" and last name is "Doe", getter should return "John Doe". Student class Instance variables: student Number (int), student (Person). gpa (double) Constructor: parameterized constructor that initializes a student with student number and all personal properties. (do you need a no-arg constructor??? Think and decide!) Methods: 1. readStudentInfo(): accepts nothing, return nothing. Reads all student information. You can declare local variables to read information, and then create student by invoking the parameterized constructor of Person class (student = new Person(.....):). In order to read marks, readMarks () method will be called from this method. 2. readMarks (): accepts nothing, return nothing. Reads number of courses, and then reads marks of all courses and stored them in a local double array. After reading the marks, this method will call calculateGpa () 3. calculateGpa (): accepts a double array, returns nothing. This method is always called from within the class (private method???). This method calculates the gpa and store it in the instance variable gpa. 4. printStudent (): accepts nothing, returns nothing. This method prints details of a student using formatted output (printf). CollegeSystem Test class This is the driver class (test class), which means this class has the main method. Main method . . This method read the number of students (store it in num), and then create an array of Student names students (Student []students new Student[num]). In a for loop, read details of students by calling readStudentInfo() method. (even though you create the students() array, each object in the array need to be created in the for loop). Prints the title and the header row In a for loop, call printStudent() method to print details of all students Format your code with proper indentation and other formatting. Your code should be properly commented. Test plan and external documentation are not required for this exercise, but in future labs they will be required. . Expected Output (user input in blue) Enter number of students: 3 Enter details of student 1 Enter student number: 1002 Enter first name: John Enter last name: Doe Enter email Id: doe@test.com Enter phone number: 123456789 Enter number of courses: 3 Enter mark 1: 98 Enter mark 2: 96 Enter mark 3: 97 Enter details of student 2 Enter student number: 1005 Enter first name: Mark Enter last name: Williams Enter email Id: mark@test.com Enter phone number: 213546879 Enter number of courses: 2 Enter mark 1: 100 Enter mark 2: 100 Enter details of student 3 Enter student number: 1008 Enter first name: Paul Enter last name: Webster Enter email Id: paul@test.com Enter phone number: 321654987 Enter number of courses: 4 Enter mark 1: 86 Enter mark 2: 95 Enter mark 3: 87 Enter mark 4: 98 List of Students KEK ***** Student# 1002 1005 1008 Name John Doe 1 Mark Williams Paul Webster 1 Email doe@test.com mark@test.com paul@test.com Phone GPA 123456789 | 3.88 213546879 | 4.00 321654987 | 3.66

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!