Question: i need a java code QUESTION 1 2 Define a class with the following specification: a) Create a class called Aircraft that has 6 private
QUESTION 1 2 Define a class with the following specification: a) Create a class called Aircraft that has 6 private data members serial Number (String), Airline company (String), model (String), speed (double), altitude (double) and fuel level (double). b) write a default constructor that sets the above attribute values to empty strings and Os e) Write one setter method for all the attributes. Make sure that the attributes newSpeed, newAltitude and newFuel in the set method are non-negative, otherwise leave the corresponding attribute unchanged. d) Write three getter methods for speed, altitude, and fuel level data members. e) Write a method named "increase Speed" which accepts a double and increase the speed by that amount when the given value is negative, the speed should remain the same. 1) Write a method named "print Details" which prints the values of all attributes of the aircraft object
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
