Question: Complete the following tasks in Java within the lab time using NetBeans. Create a class called Student and has 5 instance variable 1. ID as
Complete the following tasks in Java within the lab time using NetBeans.


Assessment 3: Classes and objects Complete the following tasks in Java within the lab time using NetBeans. Create a class called Student and has 5 instance variables 1. ID as a String 2. Name as a String 3. Age as a Integer 4. GPA as a Double 5. Time Table as a two dimensional Array of type string, that consist of name of subjects and credit hours, eg: [{OOP, 4), (English, 3), (Quran, 2... etc) Your class should have a constructor that take the ID. Name, Age, an initial GPA and initial TimeTable (use them to initialize the students' GPA and TimeTable). Your constructor should validate that the initial GPA is greater than 0, otherwise GPA should be initialized to the default value 4. Provide a set and a get method for each instant variable Ensure that the GPA in set method is grater than 0 otherwise do not change GPA value and print the fortowing error Message: The new value of the student GPA: (GPA value) is not an acceptable value please try again Add an option to Set method for 2D array takes three parameters (Integer - row index, String_- column 1 value, String -column 2 value) oto either set index value or reset array: If index >=1 Replace row with values if index = -1 rest the array (make the array empty) Add a method called TransformString olnteger that takes the second column of a two dimensional string array, transforms it to integer then returns the computed the total of credit hours Add a method called AddSubject that adds a subject to the students Time Table, check if the amounted hours is more than 16 by using TransformStringTolnteger method. o do not add subject and display an error Message: (Name of student) credit hours will exceed 16 hours. Add a method called replace Subject that takes the following parameters: o The replacement subject Credits hours o The subject that needs to be replaced o Write a class called TestStudent with a main method in this method you will create 2 objects of the class student. Prompt the user to enter the ID, Name, Age, an initial GPA and initial TimeTable. Then ask the user for the wanted operation (show Add subject, replace subject, adjust GPA) and perform it, then print the updated information
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
