Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
Create a class called Student and has 5 instance variable
1. ID as a String
2. Name as a String
3. Age as a Integer
4. GPA as a Double
5.TimeTable as two dimensional Array Of type string, that consist Of name
Of subjects and credit hours, eg:
4), {English, 3), {Quran,
Your class should have a constructor that take the Name, Age, an initial GPA and
initial TimeTable (use them to initialize the students' GPA and Your
constructor should validate that the initial GPA is greater than O, 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 Erater than O otherwise do not
change GPA value and print the following 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, column I value, String -column 2 value)
to either set index value or reset array:
If index > I
Replace row with values
if index
rest the array (make the array empty)
Add a method called that takes the secopd column of a
two dimensional string array, transforms it to ioteger then returns the computed the
total of credit hours
Add a method called that adds a subject to the students TimeTable
check if the amounted hours more than 16 by using
method.
o do not add subject and display an error Message: (Name of student)
credit hours will exceed 16 hours.
Add a method called that takes the following parameters:
o The replacement subject
o Credits hours
o The subject that needs to be replaced
Write a class called 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 it, then print the updated information.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started