Question: Write a Java class definition for an Airplane. The Airlplane class should have the following data members: airplane_type: String Curent-speed: double max speed: double implement

Write a Java class definition for an Airplane. The Airlplane class should have the following data members:

airplane_type: String

Curent-speed:

double max speed:

double implement non-default constructor, do not implement the getters and setters, unless it is necessary for the solution. Make sure your solution does not violate the encapsulation concept.

The set current speed function (given below) has the potential of generating an exception of type llegalAgumentException add the necessary code in order to make your class definition more robust and achieve data validation. void set current_speed( double cur speed in)

{

current_speed =cur_speed _in

}

You have given a file called "airplane.dat' sample data is given below. Writea Driver class that reads the data form the file, then instantiates Airplane objects and add them to an Array list. Based on your answer to previous parts of the question. write your code to illustrate Java exceptionhandling mechanism. Sample file:

 Write a Java class definition for an Airplane. The Airlplane class

to illustrate Java exception handling chanism. ple file: Type Max Speed Current Speed 1000 850 1200 900 Boeing 775 Airbus_338

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!