Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Confused on where to start. suppose to use 3 constructors as stated below to make the object below. Programming language is Java. Type or paste

Confused on where to start. suppose to use 3 constructors as stated below to make the object below. Programming language is Java.

image text in transcribedType or paste question here

1/3 width (x, y) = body - height 12 height engines width The Hero class should support 3 constructors, that each create and store the basic properties of the ship (as provided in the UML diagram below): 1. A default constructor (no arguments) a. Default size (width x height) is 40 x 50 b. Default position (x,y) = (0,0) c. Default body colour black d. Default engine colour=red 2. Two custom constructors (according to the UML diagram below) a. Where values not provided as arguments are set to defaults as per (1) above Hero Hero +x: double +y: double + width : double + height: double + body : Color + engines : Color Color + Hero + Hero(double x, double y) + Hero(double x, double y, Color body, Color engines) + toString0 : String UML representation of aggregation "Hero aggregates 2 Color objects

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions