Question: Complete the following tasks in Java within the lab time using NetBeans. Each task should be completed in a separate class Task 1: Create a

Complete the following tasks in Java within the lab time using NetBeans. Each task should be completed in a separate class Task 1: Create a new class called Person with two data members: The person name (name) as a String The ID number (ID) as a long Note that all data members should be declared private and you can add any needed constructors and methods. Create a method toStrig for this class Write a Student class that extends from the Person class and has the following attributes: The list of courses the student has as an array of integers with a maximum size of 5 which should contain the courses IDs The marks the student had at these courses as an array of doubles with the maximum size of 5. The number of courses the student had registered. This class should also have the following methods 1. The class must also have 2 constructors (no argument constructor and the full argument constructor) 2. AddCourse: which should receive the course ID as an argument and add it to the array. This method should also update the number of course accordingly. 3. AddMark: this method should receive the course ID and the mark as arguments and then update the correct course mark. 4. An override toSting method. Write a PostStudent class that extends from the Person class and has the following attributes: The list of courses the student has as an array of integers with a maximum size of 3 which should contain the courses ID The grade that the student had at these courses as an array of String with the maximum size of 3. Grade are (Pass -Good-VeryGood - Excellent) This class should also have the following methods 5. The class must also have 2 constructors (no argument constructor and the full argument constructor) 6. AddCourse: which should receive the course ID as an argument and add it to the array, This method should also update the number of course accordingly. 7. AddGrade this method should receive the course ID and the grade as an arguments and then update the correct course grade. 8. An override tosting method. Create a TestStudent which is a java class with a main method. In this method, you will: Create a TestStudent which is a java class with a main method. In this method, you will: Use a loop to create several objects from the type Student and PostStudent. At every cycle, you will ask the user to inform you is it a post student or an undergraduate student accordingly, you will need to generate a new student object or a new PostStudent object. Ask the user to fill in all the required information (student ID, courses and marks or grad) before adding this object into an array of size 10 from the type Person After entering the students' details (5 students for example) a new loop should print all this information, on the screen Task 2: Create a new Course class with the attribute of: The course name (name) as a String. The course ID number (ID) as a long Note that all data members should be declared private and you can add any needed constructors and methods Create a method toStrig for this class, Update the class Student and class PostStudent to have an array of Course objects with maximum size of 5 instead of having an array of integers that was contain courses IDs. Update the AddCourse method to receive the course object as an argument and add it to the array. Also update the implementation of add mark method and any other methods that needed to be updated based on that change. At every cycle in the main you need to create Course object and fill it(read the course ID and course name from the user )and then use it to fill the student course array by sending the object as argument to the AddCourse method). Fill all the required information (student name, id, courses and marks) of the array of objects of type Student and then after entering the students' details (5 students for example) a new loop should print all this information, on the screen
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
