Question: Please submit one source code file ( . java file ) for each exercise. ( Ex . Lab 1 0 Ex 1 . java, Lab

Please submit one source code file (.java file) for each exercise. (Ex. Lab10Ex1.java, Lab10Ex2,java, Lab10Ex3.java ...etc).
Remember to follow the commenting guidelines.
Program 1: Creating objects (40 points):
Imagine you are working on a fleet simulation for the US Navy. Each ship will be an instance of its ship type.
Define a class with the following fields, methods, and constructor. Watch out to make the specified fields and methods private instead of public.
Using that class, create two instances of carriers:
Instance: CVN68
Name="Nimitz"
Instance: CVN81
Name="Doris Miller "
Tons=100000
Length=1106
Personnel =4660
Aircraft=85
Carrier(newname: String) :void
Carrier(newname: String, newlength: int) :void
Carrier(newname: String, newlength: int, newpersonnel: int, newair:int) :void
setTons(newtons: int) :void
getName() :String
getTons() :int
Submit both the .java file with the Carrier class, and the .java file with your main program.
Please submit one source code file ( . java file

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!