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

 i need a java code QUESTION 1 2 Define a class
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 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

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 Databases Questions!