Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

**USING ECLIPSE JAVA ** **source code and output** 1.Modify the Student class (presented to you) as follows: (a) Each student object should also contain the

**USING ECLIPSE JAVA **

**source code and output**

1.Modify the Student class (presented to you) as follows:

(a) Each student object should also contain the scores for three tests.

(b) Provide a constructor that sets all instance values based on parameter values.

(c) Overload the constructor such that each test score is assumed to be initially zero.

(d) Provide a method called setTestScore that accepts two parameters: the test number (1 through 3) and the score.

(e) Also provide a method called getTestScore that accepts the test number and returns the appropriate score.

(f) Provide a method called average that computes and returns the average test score for this student.

(g) Modify the toString method such that the test scores and average are included in the description of the student.

(h) Create a driver class main method to exercise the new Student methods.

2. Write a class called Course that represents a course taken at a school. Represent each student using the modified Student class from the previous question.

(a) Use an ArrayList in the Course to store the students taking that course.

(b) The constructor of the Course class should accept only the name of the course.

(c) Provide a method called addStudent that accepts one Student parameter.

(d) Provide a method called average that computes and returns the average of all students test score averages.

(e) Provide a method called roll that prints all students in the course.

(f) Create a driver class with a main method that creates a course, adds several students, prints a roll, and prints the overall course test average.

3. Design and implement a set of classes that

(a) Define various types of reading material: books, novels, magazines, technical journals, textbooks, and so on.

(b) Include data values that describe various attributes of the material, such as the number of pages and the names of the primary characters.

(c) Include methods that are named appropriately for each class and that print an appropriate message.

(d) Create a main driver class to instantiate and exercise several of the classes.

4. Modify the Firm example from week4 lecture such that all employees can be given different vacation options depending on their classification.

(a) Provide a method called vacation that returns the number of vacation days a person has.

(b) Give all employees a standard number of vacation days (14), then override the method in the various employee classes as appropriate.

(c) Modify the driver program to demonstrate this new 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

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions