Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

According to the inheritance hierarchy in the following Figure 1, and the provided Shape class and Circle class: Shape - area (double) -color (String) -

According to the inheritance hierarchy in the following Figure 1, and the providedShapeclass andCircleclass:

image

Shape - area (double) -color (String) - name(String) + Shape(String, String) + getArea(): Double + getName(): String + setColor(String) + calArea( ) +printStr(): String public class Shape { private double area; private String color; private String name; public Shape(String c, String n) { color = c; name = n; } public double getArea() { return area; } - radius (double) Circle + Circle(String, String, double) + getRadius(): double public String getName() { } return name; public void setColor(String c) { color = c; + setRadius(double) } +calArea() +printStr(): String public void calArea() { Figure 1. Inheritance hierarchy area = 0; } public String printStr() { return "name = "I + name + + "color = +color+ " "; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

It seems like the implementation of the Shape and Circle classes is incomplete in the given code sni... 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

Systems Analysis And Design With UML 2.0

Authors: Alan Dennis, Barbara Haley Wixom, David Tegarden

4th Edition

1118037421, 978-1118037423

Students also viewed these Programming questions

Question

2. Do not crowd the student. Do not get in the students face.

Answered: 1 week ago

Question

What is a stub and why is it used in testing?

Answered: 1 week ago