Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(1) Shapes Class Hierarchy Implement a java class hierarchy that represents at least three different shapes: circles, rectangles, and squares. The base class called Shape

(1) Shapes Class Hierarchy Implement a java class hierarchy that represents at least three different shapes: circles, rectangles, and squares. The base class called Shape must have an abstract method called getArea() which is overridden in the derived classes for each shape to produce the correct result. Each derived class must have a constructor which has arguments that are specific for each shape type. All the fields must to have Private access modifier. Create setter and getter functions for each field. Create function which prints all fields. For example, each rectangle requires a width and a height while each circle requires only a radius. In other words, you must write 5 java classes: Shape.java, Circle.java, Rectangle.java, Square.java, ShapeDemo.java (the driver class). The driver class must instantiate objects of each shape type and demonstrate their functionality (i.e., their ability to calculate their own shape). (2) Exam Class Hierarchy Implement a java class hierarchy that represents at least three different types of exams: quizes, midterms, and finals. The base class called Exam must have three abstract methods called getPoints(), setPoints(), and getNormalizedScore(). In addition to that, each derived class must have a constructor which takes as parameters the minimum number of points for this exam (e.g. 0), the maximum number of points for the exam (e.g., 100), and the weight of this exam (e.g., 20%). All the fields must to have Private access modifier. Create setter and getter functions for each field. Create function which prints all fields. In other words, you must write 5 java classes: Exam.java, Quiz.java, Midterm.java, Final.java, ExamDemo.java (the driver class). The driver class must instantiate objects of each exam type and demonstrate their functionality (i.e., their ability to calculate normalized scores).

write a program in Java

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

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

More Books

Students also viewed these Databases questions

Question

9. Identify four interaction styles in intercultural marriages.

Answered: 1 week ago