Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Only please Expected toString output Your output need not be identical to that shown here, but you must include all instance values in the

Java Only please

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Expected toString output Your output need not be identical to that shown here, but you must include all instance values in the output, in the order shown.

TI Oceania is a(n) Oil Tanker with a volume capacity of 503410 cubic meters built by Daewoo Shipbuilding & Marine Engineering in 2003.

Celebrity Equinox is a Luxury Cruise with a passenger capacity of 2850 passengers built by Meyer Werft in 2009.

Hint: To test your Classes, you can write a testShip class with a main() method, that instantiates objects from both Tanker and Cruise classes.

Instructions Modify class Ship to meet the revised requirements described in the following UML Class Diagram Ship Attributes private name: String private year: int private builder: String Name of the ship Year of build Builder company Operations Ship(name: String, Default or null constructor Constructor accepting three (3) parameters. Returns a fully formed and fully functional Ship object reference year: int, builder: String): Ship public setName(aName: String): void public setYear(aYear: int): void public setBuilder(aBuilder: String): voidAccepts a String object local name:aBuilder) and assigns Accepts a String object(local name:aName) and assigns it to the instance variable name Accepts an int value(local name:aYear) and assigns it to the instance variable year ublic getName): String ublic getYear): int ublic getBuilder(): String it to the instance variable builder Returns the current value of instance variable name Returns the current value of instance variable vear Returns the current value of instance variable builder Returns a formatted String containing a 'state report', that is, the current values of each of the object's instance variable public toString(): String

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

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

Professional SQL Server 2012 Internals And Troubleshooting

Authors: Christian Bolton, Justin Langford

1st Edition

1118177657, 9781118177655

Students also viewed these Databases questions

Question

=+ What is the role of government in bargaining?

Answered: 1 week ago

Question

=+ Who is the negotiation partner at company level?

Answered: 1 week ago

Question

=+Which associations exist?

Answered: 1 week ago