Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can someone please give me the psuedocode for this program? The super class is Ship . create the three sub - classes ( Yacht ,
Can someone please give me the psuedocode for this program?
The super class is Ship
create the three
subclassesYachtCruiseShip, CargoShip complete with all setters and getters for the new
attributes as well as the toString method that uses the supers toString method.
create a driver class called FlotillaDriver that is
required to do specific tasks.
For the Yacht, there are four additional fields indicating the
number of state rooms, the size of the pool, the number of
decks and the size of the engine.
For the Cruise ship, there are three additional fields indicat
ing the number of executive room, the number of double
rooms and the number of quad rooms.
For the Cargo Ship, there are two additional fields indicating
the maximum weight of cargo allowed and the amount of re
frigerated storage the ship has.
Open the text file called flotilla.csv and load all ship using
the appropriate subclass into an ArrayList dedicated to the
super class Ship.
Instantiate the proper sub ship object to add to the list.Only the basic ship information in the initial list,
but when creating the displays when one of the buttons is
clicked, you must provide the additional information of the
individual sub ship.
The organization for each line of data within the file starts
with the subship code that lets you know what type of sub
ship you have. The next six fields are the ships name, year of
built, country of registration, length, draft and beam. The
data following this depends on the the type of ship represent
ed At this point you will need to use a decision structure
based on the subship code to determine how to access the
data.
These displays MUST be created outside of the file reading
loop. This is to give you practice iterating through a list of ob
jects, using the instanceOf operator to determine the type of
object it is
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started