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:
to illustrate Java exception handling chanism. ple file: Type Max Speed Current Speed 1000 850 1200 900 Boeing 775 Airbus_338Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started