public Plane () – this is the default constructor; it assigns the following initial values to the instance variables: | airline: Southwest model: 747 year of the plane: 2021 gallons per hour: 3600.0 fills the tank sets the flying hours to zero

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Implement a class called Plane

Constructors
public Plane () – this is the default constructor; it assigns the following initial
values to the instance variables:
airline: Southwest
model: 747
year of the plane: 2021
gallons per hour: 3600.0
fills the tank
sets the flying hours to zero
sets the next inspection reminder.
public Plane (String airline, String model, int y, double
gph) - this constructor sets the airline, model, year and gallons per hour to the provided
input parameters and sets the rest of the instance variables to the same values as the
default constructor does.
Accessor Methods
public String getAirline ( ) - return the airline of the plane.
public String getModel ( ) - return the model of the plane.
public double getGph ( ) - return the gallons per hour.
public int getYear () - return the year of the plane
Transcribed Image Text:Constructors public Plane () – this is the default constructor; it assigns the following initial values to the instance variables: airline: Southwest model: 747 year of the plane: 2021 gallons per hour: 3600.0 fills the tank sets the flying hours to zero sets the next inspection reminder. public Plane (String airline, String model, int y, double gph) - this constructor sets the airline, model, year and gallons per hour to the provided input parameters and sets the rest of the instance variables to the same values as the default constructor does. Accessor Methods public String getAirline ( ) - return the airline of the plane. public String getModel ( ) - return the model of the plane. public double getGph ( ) - return the gallons per hour. public int getYear () - return the year of the plane
public double getHoursNextInspection ( ) - return hours of next inspection
public double checkFlyingHours ( ) - return the current amount of hours
flown.
public double checkGas Gauge ( ) - return the amount of fuel in the tank.
public String toString ) - return (don't print) a formatted String of the
plane. Use the DecimalFormat class to format the hours flown and fuel in tank to
include the commas and the two decimals as needed.
Example:
Delta 747 2021 Flight Hours: 10.50 JetFuel in Tank: 35,000.00
Mutator Methods
public void setAirline (String airline) – set the airline of the plane to
the value of the input parameter
public void setModel (String model) – set the model of the plane to the
value of the input parameter
public void setGph (double value) – set the gallons per hour of the plane
to the value of the input parameter
public void setYear (int y) – set the year of the plane to the value of the
input parameter
Transcribed Image Text:public double getHoursNextInspection ( ) - return hours of next inspection public double checkFlyingHours ( ) - return the current amount of hours flown. public double checkGas Gauge ( ) - return the amount of fuel in the tank. public String toString ) - return (don't print) a formatted String of the plane. Use the DecimalFormat class to format the hours flown and fuel in tank to include the commas and the two decimals as needed. Example: Delta 747 2021 Flight Hours: 10.50 JetFuel in Tank: 35,000.00 Mutator Methods public void setAirline (String airline) – set the airline of the plane to the value of the input parameter public void setModel (String model) – set the model of the plane to the value of the input parameter public void setGph (double value) – set the gallons per hour of the plane to the value of the input parameter public void setYear (int y) – set the year of the plane to the value of the input parameter
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Unreferenced Objects
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education