Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SYST 17796 ICE 3 This exercise is to be completed individually during class time. Students are allowed to discuss the exercise and provide assistance to

SYST 17796

ICE 3

This exercise is to be completed individually during class time. Students are allowed to discuss the exercise and provide assistance to one another but each student is responsible for their own final product. Students not present in class are not eligible for credit unless they are eligible for a specific accommodation which is worked out between the instructor and that student according to class/departmental/college policies.

Overview

This Exercise will allow students to demonstrate their understanding of the following critical concepts:

  • UML class diagrams
  • Principles of OO Design, Inheritance, Interface

Credit/Necessary Information

TASK

1. Submit an image of completed class diagrams and your source codein a .zip file to the DropBox. (one image + one zip file) Submissions not in this format will not be evaluated.

In a course, a teacher gives the following tests and assignments:

  • A lab activity that is observed by the teacher and assigned a numeric score.
  • A pass/fail exam that has 10 questions. The minimum passing score is 70.
  • An essay that is assigned a numeric score.
  • A final exam that has 50 questions.

Write a class namedCourseGrades. The class should have an array ofGradedActivity objects as a field. The array should be namedgrades. Thegrades array should have four elements, one for each of the assignments previously described. The class should have the following methods:

setLab

This method should accept aGradedActivity object as its argument. This object should already hold the student's score for the lab activity. Element 0 of thegrades field should reference this object.

setPassFailExam

This method should accept aPassFailExam object as its argument. This object should already hold the student's score for the pass/fail exam. Element 1 of thegrades field should reference this object.

setEssay

This method should accept anEssay object as its argument. This object should already hold the student's score for the essay. Element 2 of thegrades field should reference this object.

setFinalExam

This method should accept aFinalExam object as its argument. This object should already hold the student's score for the final exam. Element 3 of thegrades field should reference this object.

toString

This method should return a string that contains the numeric scores and grades for each element in thegrades array.

Demonstrate the class in a program.

Analyzable Interface

Modify theCourseGrades class you created so that it implements the following interface:

public interface Analyzable

{

double getAverage();

GradedActivity getHighest();

GradedActivity getLowest();

}

ThegetAverage method should return the average of the numeric scores stored in thegrades array. ThegetHighestmethod should return a reference to the element of the grades array that has the highest numeric score. ThegetLowestmethod should return a reference to the element of the grades array that has the lowest numeric score. Demonstrate the new methods in a complete program.

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

Technical Change, Relative Prices, And Environmental Resource Evaluation

Authors: V Kerry Smith

1st Edition

1317358570, 9781317358572

More Books

Students also viewed these Economics questions

Question

Create a Fishbone diagram with the problem being coal "mine safety

Answered: 1 week ago