Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed 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.
image text in transcribed
image text in transcribed
image text in transcribed
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

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

Students also viewed these Databases questions

Question

=+2 Why are so many countries bothered by their brain drains?

Answered: 1 week ago

Question

What do Dimensions represent in OLAP Cubes?

Answered: 1 week ago