Answered step by step
Verified Expert Solution
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
points Assign age and gpa to objects using
a random classimethod provided by the Java SEEE libraries.
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
UndergraduateStudentname:String, studentD: int, age: int, gpa: float
setStudentGpagpafloat: 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 and
In the StudentDriver main method.
Create an array of undergraduate students with elements.
Create an ArrayList of graduate students with 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
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 for gpe. Naturaly, this time start your prints
"The average gpa..."
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