subject
Computers and Technology, 29.06.2019 12:20 nisha87

Chapter 10. pc #10. ship, cruiseship, and cargoship classes (read instructions carefully) design a ship class that the following members: • a field for the name of the ship (a string). • a field for the year that the ship was built (a string). • a constructor and appropriate accessors and mutators. • a tostring method that displays the ship’s name and the year it was built. design a cruiseship class that extends the ship class. the cruiseship class should have the following members: • a field for the maximum number of passengers (an int). • a constructor and appropriate accessors and mutators. • a tostring method that overrides the tostring method in the base class. the cruiseship class’s tostring method should display only the ship’s name and the maximum number of passengers. design a cargoship class that extends the ship class. the cargoship class should have the following members: • a field for the cargo capacity in tonnage (an int). • a constructor and appropriate accessors and mutators. • a tostring method that overrides the tostring method in the base class. the cargoship class’s tostring method should display only the ship’s name and the ship’s cargo capacity. in the main class, you should read the input file and create an array containing ship, cargoship, cruiseship objects based on the information provided on each line. the file is in csv (comma separated values) format. this means each line contains multiple data elements separated by comma. you can use scanner class to input the data or if you know how to work with stringtokenizer you can also use it. another option is to use the split() method in the string class. the first column in the file contains the ship type (“ship”, “cruiseship”, or “cargoship”) as a string. the second column contains the ship name as a string. the third column contains year built as a string. the forth column contains different information for different ship types: for ship type = “ship” - empty (ignore) for ship type=”cargoship” - cargo capacity (int) for ship type=”cruiseship” - max passengers (int)in java language. ouputcruise ship\n ship name: aegean spirit\n year built: 2003\n max passengers: 4,500\nstandard ship\n ship name: classica\n year built: 1990\ncargo ship\n ship name: edith maersk\n year built: 2007\n cargo capacity: 170,794\ncargo ship\n ship name: emma maersk\n year built: 2006\n cargo capacity: 156,907\ncruise ship\n ship name: enchanted capri\n year built: 1970\n max passengers: 7,000\ncargo ship\n ship name: estelle maersk\n year built: 2006\n cargo capacity: 151,687\ncruise ship\n ship name: explorer of the seas\n year built: 2001\n max passengers: 9,500\nstandard ship\n ship name: mv delight\n year built: 1985\ncargo ship\n ship name: ocean glory\n year built: 2006\n cargo capacity: 161,788\ncruise ship\n ship name: our lady\n year built: 1960\n max passengers: 3,500\nstandard ship\n ship name: provence\n year built: 1995\nstandard ship\n ship name: ss desabla\n year built: 1913\ncruise ship\n ship name: symphony\n year built: 2001\n max passengers: 10,000\n

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:20
This os integrated the processing power of windows nt with the easy-to-use gui of windows 98. windows 2000 windows 3.11 windows for workgroups windowa millennium edition
Answers: 1
question
Computers and Technology, 22.06.2019 18:30
Which cultural aspect does this type of song best portray? a german polka dance
Answers: 1
question
Computers and Technology, 23.06.2019 04:31
Cloud computing service providers manage different computing resources based on the services they offer. which resources do iaas and paas providers not manage? iaas providers do not manage the for the client, whereas paas providers usually do not manage the for their clients. iaas- storage server operating system network paas- applications interafce storage vertualiation
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
:you areto design the controller for alight that functions both as an ordinary light and also as a motion activated light and alarm. a.if the manual switch s is on, then the light l is on. b.besides the manual switch, there is a motion detector, m1, which activatesthis light.c.if motion is detected but the light is on anyway because s is on, only then a secondoutput a, an alarm, is turned on. d.the disable switch, d, disables the motion activated light and alarmbut leaves manual control operation of the light using switch s.(i)read the problem statement and clearly identify the inputs and outputs for the circuit you are designing. (ii)create the truth table for this system; include the light, alarm, switch, disable, and the motion sensor.(iii)draw a schematic of this system.
Answers: 1
You know the right answer?
Chapter 10. pc #10. ship, cruiseship, and cargoship classes (read instructions carefully) design a s...
Questions
question
English, 10.03.2021 20:00
question
Health, 10.03.2021 20:00
question
Mathematics, 10.03.2021 20:00
question
Mathematics, 10.03.2021 20:00
question
Chemistry, 10.03.2021 20:00
Questions on the website: 13722367