
Write a program that has a base class named FlightCrew. This class should
have three data members: an integer to store the ID of the crew member, an
integer to store the number of years of service and another integer to store
the total salary of the member. Provide a parameterized constructor in the
class to set the values of the data members.
Derive a class Pilot from FlightCrew to contain two additional data members,
an integer to store the number of hours of flight and a boolean to store
whether the Pilot has military experience or not. Provide a paramete rized
constructor in the Pilot class. Provide a function bonus() in the class where
the bonus of a pilot is his number of flight hours times the 10% of his salary.
Likewise, provide a function isEligible() in the class to find out if the pilot is
eligible for promotion or not. A pilot is eligible for promotion to the next
rank if he has at least 5 years of experience and the number of total flight
hours is greater than 100.
Derive another class CabinCrew from FlightCrew. This class should contain
data members to store the number of trainings the crew member has under
taken and the total number of flights on which a member has served and a
parameterized constructor to set the data members.
Similar to the Pilot class, provide bonus() and isEligible() functi ons in the
CabinCrew class. The bonus of a crew member is the number of flights times
5% of the salary while a member is eligible for promotion if he has served on
at least 10 flights and has under gone at least 5 training workshops.
In the main program, create objects of Pilot and CabinCrew using dynamic
memory allocation and call the bonus() function of each.

Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images

- In C++ Q1.) Write a Review class that has: • These private data members: • string user: ID of the user • string item: ID of the item • double paid: the price of the item that the user buys • double rating: the rating that the user gives to the item • string review: the review content that the user gives to the item • These public member functions: • A default constructor to set all instance variables to a default value • A parameterized constructor (i.e., a constructor with arguments) to set all instance variables • A method for getting/setting the instance variables. • A method for printing the Review's information.arrow_forwardPLZ help In Javaarrow_forwardPeople in School Objective: At the end of the activity, the students should be able to: Create a program that exhibits inheritance. Procedure: Write a simple information system that will store and display the complete information of a student, faculty, or employee. Create four (4) no-modifier classes named Person, Student, Faculty, and Employee. Create a public class named CollegeList. This class shall contain the main method. Refer to the UML Class Diagram for the names of the variables and methods. The (-) symbol represents private variables, while (+) represents public method. This should be the sequence of the program upon execution: Prompt the user to select among Employee, Faculty, or Student, by pressing E, F, or S. Ask the user to type the name and contact For Employee, ask the user to type the employee's monthly salary and the department where he/she belongs to (Ex. Registrar). Then, display name, contact number, salary, and For Faculty, ask the user to press Y if…arrow_forward
- In a class with overloaded constructors, each version of the constructor must have a differentarrow_forwardC- Create the sub class UsedBook that is derived from the super class Book and has the following instance variables, constructor, and functions: title ( String) isbn ( String) authors (String) publisher (String) edition ( int) published_year (int) price_new (double) // the price of the book if it is new age (int) // how old the book is in years Constructor that takes all of the above variables as input parameters. set/get functions calculate_price method // the price is calculated as price_new * (1- 0.10*age) print function that prints all information related to the old book. D- Create the Testing class that has the main method and does the following: aa- Use the constructor to create instance of NewBook class and name it as new. Call compute_price function. bb- Use the constructor to create instance of usedBook class and name it used. Call compute_price function. cc- Print the related information of new and used objects using print functions. Use this following code: class…arrow_forwardDesign a class named Pet, which have the following fields: • Name - name of the pet. • Animal - type of animal that a pet is (Dog, Cat, Bird). • Age - age of the pet. The Pet class should also have the following methods: • setName • setAnimal • setAge • getName •.getAnimal .getAge a) Draw a UML diagram of the class. Be sure to include notation showing each field and method's access specification and data type. Also include notation showing any method parameters and their data types. b) Write the Java code for the Pet class. Create a main method in the same class and instantiate at least two objects of the class.arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY





