Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Note. The goal of this exercise is to learn comparing two sets of objects constructed with different mechanisms such as an array of objects and

Note.
The goal of this exercise is to learn comparing two sets of objects
constructed with different mechanisms such as an array of objects
and an ArrayList of objects.
Deliverables:
Turn in the java class fies for each class. Capture the screen output
and convert it to a pdf file. Tum in the screen output file.
Following the instructions and good coding practices are also a part
of your grade.
Note..
Extra Credit
(5 points) Assign age and gpa to objects using
a random classimethod provided by the Java SE/EE libraries.
(10 points) Within the StudentDriver class,
create necessary methods to order the groups (array
and arraylist) based on age and gpe.
Then order the students for each group based on age and goa.
Print the students based on the ordered list for the array
and arraylist.name: String
shudentID : int
age ; int
Tpa ; foat
UndergraduateStudent(name:String, student1D: int, age: int, gpa: float)
setStudentGpa(gpafloat): void
getStudentName(): String
getStudentID(): int
getStudentAge(): int
getStudentGpa(): fioat
printStudentinformation(): voidNote.
Implement the design. Create the classes in the UML design with the
necessary methods and attributes.
In the class constructors, follow good coding practices and
assign acceptable values to the appropiate attributes.
As a developer, determine what these values can be
(for example gpa is between 0.00 and 4.00).
In the StudentDriver main method.
Create an array of undergraduate students with 4 elements.
Create an ArrayList of graduate students with 5 elements.
Remember to add the students to the arraylist.
Assign any acceptable values for all student objects.
Print student information for all students.
Calculate the average age for each group of students
(undergraduate and graduate) using the enhanced for loop.
Compare the average age and print the message such as
"The average age for undergraduate students is ?7+
averagaAgeForUndemraduateStudents
"The average age for graduate students is "+
averagaAgeForGraduateStudents
"The average age is higher in ....."(Undergrad or Grad whichever is higher)
Also calculate the average gpa for each groups.
Repeat step 7 for gpe. Naturaly, this time start your prints
"The average gpa..."
image text in transcribed

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data Systems A 360-degree Approach

Authors: Jawwad ShamsiMuhammad Khojaye

1st Edition

0429531575, 9780429531576

More Books

Students also viewed these Databases questions