Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use Inheritance method to create the class (Java) Please create a testing class and the possible interface is as follows: WELCOME TO Fun Shape

Please use Inheritance method to create the class (Java)

image text in transcribed

Please create a testing class and the possible interface is as follows:

WELCOME TO Fun Shape App

How many circle(s) would you like to create? [1]

How many square(s) would you like to create? [1]

How many rectangle(s) would you like to create? [1]

  • What is the colour of your number 1 circle ?
  • What is the radius of your number 1 circle?
  • :

:

:

Shape -color:String "red" -filled:boolean = true +Shape() +Shape(color:String, filled: boolean) +getColor(): String +setColor(color:String):void +isFilled(): boolean +setFilled(filled:boolean):void +toString(): String extends "Shape[color=?, filled=?]" Circle = 1.0 -radius: double +Circle() +Circle(radius: double) +Circle(radius: double, color:String, filled:boolean) +getRadius(): double +setRadius (radius: double): void +getArea(): double +getPerimeter(): double +toString(): String. Rectangle -width: double = 1.0 - length:double = 1.0 +Rectangle() +Rectangle(width:double, length: double) +Rectangle(width:double, length: double, color:String, filled: boolean) +getWidth(): double +setWidth(width: double):void +getLength(): double +setLength(legnth: double):void +getArea(): double +getPerimeter(): double o+toString(): String "Circle(Shape[color=?, filled=?], radius=?]" "Rectangle[Shape[color=?, filled=?],width=?, length=?]" Square The length and width shall be set to the same value. +Square() +Square(side: double) +Square(side: double, color:String, filled:boolean) +getSide(): double +setSide (side: double):void +setWidth(side:double):void +setLength(side: double):void +toString(): String "Square[Rectangle[Shape[color=?, filled=?], width=?, length=?]]

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

Students also viewed these Databases questions

Question

=+ 9. Why cant the Fed control the money supply perfectly?

Answered: 1 week ago