Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can someone please give the java code that fits this problem description? Information: The sub - classes and their fields are including all setters and
Can someone please give the java code that fits this problem description? Information: The subclasses and their fields are including all setters and getters Yacht: number of state rooms, the size of the pool, the number of decks and the size of the engine. CruiseShip: number of executive room, the number of double rooms and the number of quad rooms. CaargoShip: two additional fields indicating the maximum weight of cargo allowed and the amount of re frigerated storage the ship has. The superclass is Ship its fields are name, nation, year, length, draft, beam. With all getters and only the setters for name and nation. Problem description: Create a driver class called FlotillaDriver that is required to do specific tasks. 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. The initial list will only need the basic ship information but when creating the displays when one of the buttons is clicked, you must provide the additional information of the individual sub ship. Purpose: load all information from the unique subclasses into a list of the superclass.
Can someone please give the java code that fits this problem description?
Information:
The subclasses and their fields are including all setters and getters
Yacht: number of state rooms, the size of the pool, the number of
decks and the size of the engine.
CruiseShip: number of executive room, the number of double
rooms and the number of quad rooms.
CaargoShip: two additional fields indicating
the maximum weight of cargo allowed and the amount of re
frigerated storage the ship has.
The superclass is Ship its fields are name, nation, year, length, draft, beam. With all getters
and only the setters for name and nation.
Problem description:
Create a driver class called FlotillaDriver that is
required to do specific tasks.
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. The initial list will only need the basic ship information
but when creating the displays when one of the buttons is
clicked, you must provide the additional information of the
individual sub ship.
Purpose: load all information from the
unique subclasses into a list of the superclass.
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