Question: (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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!