Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Design, code and test two classes to model a solution to the following problem. Also, use Javadoc comments, and generate a docs folder at end!

Design, code and test two classes to model a solution to the following problem. Also, use Javadoc comments, and generate a docs folder at end! 1. Create a new Eclipse project HW01_01YourName A RollBook contains zero or more instances of Student objects such as Doe, John or Brown, Sally Each Student has a name as a single string in format shown above (Last, First) A Student also has a gpa which is a decimal number in the range 0.0 to 4.0 2. Write class Student sufficient to model the above problem. -- Hint: instance variables, a constructor with two parameters, and setter and getter methods. 3. Write class RollBook with methods: no-arg Constructor void addStudent(String name, double gpa) //creates new Student object // and adds to collection Compute the average gpa of all students -- returns value as a decimal number Count the number of students with gpa higher than some parameter value [e.g.. a param of 3.2 value counts all students with gpa greater than or equal to 3.2] - returns count Determine if a student with a particular name is in the class -- returns true or false. [Example: is Brown, Sally in the class?] o Hint: String compare requires str.equals(.. ) not == Use an ITERATOR in a void method listThreshhold(double th) that will LIST (output to screen) the names and gpas of all students with gpa higher than some parameter value [e.g.. 3.2 value displays all students with gpa greater than or equal to 3.2] - void method 4. Create a TestClass with a main() method to instantiate a RollBook with some test data, then call your methods to demonstrate functionality

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

Recommended Textbook for

Contemporary Issues In Database Design And Information Systems Development

Authors: Keng Siau

1st Edition

1599042894, 978-1599042893

More Books

Students also viewed these Databases questions