
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Kindly Solve this C++ question as per the instructions. Thank you for your help!
Instructions:
1- Put the class definition in Flight.h and the implementation of the constructors and functions in Flight.cpp
Implement the Flight.h and Flight.cpp so that class Flight contains:
- 4 private instance variables: Name of data type string, which describe the three electric vehicle charger types (AC975, DL521, and AC863). Destination of data type string that shows the final destination of that flight. Hour and Minute of data type int that show the departure time.
- A default constructor which sets all of the numeric instance variables to zero and the String instance variables to null.
- A constructor with 4 parameters that sets the 4 instance variables to the corresponding values passed.
- Implement an accessor method for each information (Flight name, Flight destination, and Flight Time) that will return the value of the instance variable. For example, the getX() method for the instance variables Hour and Minute must be called getTime().
- Implement a mutator method for each instance variable that will assign to the instance variable to the value passed. For example, the setX() method for the instance variables Hour and minute must be called setTime().
- An equals function: two objects of type flight have a similar destination or not. If they have similar destination, this function returns a Boolean value true.
- An Airline function, which shows the airline operator of a flight based on the first two letters of its name:
1) For flight AC975, it shows "Air Canada".
2) For flight DL521, it shows "Delta" - A printinfo function which prints out the flight information in the following format:
(Name> flight to Destination> at <hour): (minute).

Transcribed Image Text:1- Put the class definition in Flight.h and the implementation of the
constructors and functions in Flight.cpp
Implement the Flight.h and Flight.cpp so that class Flight contains:
✔4 private instance variables: Name of data type string, which describe the three electric
vehicle charger types (AC975, DL521, and AC863). Destination of data type string that
shows the final destination of that flight. Hour and Minute of data type int that show the
departure time.
✔A default constructor which sets all of the numeric instance variables to zero and the String
instance variables to null.
✔A constructor with 4 parameters that sets the 4 instance variables to the corresponding values
passed.
✓ Implement an accessor method for each information (Flight name, Flight destination, and Flight
Time) that will return the value of the instance variable. For example, the getX() method for
the instance variables Hour and Minute must be called getTime ().
✓ Implement a mutator method for each instance variable that will assign to the instance variable
to the value passed. For example, the setX() method for the instance variables Hour and
minute must be called setTime().
✓An equals function: two objects of type flight have a similar destination or not. If they have a
similar destination, this function returns a Boolean value true.
✓An Airline function, which shows the airline operator of a flight based on the first two letters
of its name:
o For flight AC975, it shows "Air Canada".
o
For flight DL521, it shows "Delta".
Aprintinfe function which prints out the flight information in the following format:
(Name> flight to Destination) at chour): (minute).

Transcribed Image Text:Create a file yul.cpp with the main function that asks the user to enter the information to create two
flight objects. Then use printinfo() and Airline () functions to display the flight and airline
information. Afterward by using the equals(@pction the following results are displayed: (Text
in green is user input)
What flight are you looking for? AC975J
What is the destination? France
What is the departure time? 1458.
What flight are you looking for? DL521J
What is the destination? New York.
What is the departure time? 8530.J
The two flights are:
AC975 flight to France at 14:50, Air Canada
DL521 flight to New York at 85:30, Delta
Are the two flights to the same destination?
No
What flight are you looking for? AC975.J
What is the destination? Franced
What is the departure time? 1458.J
What flight are you looking for? AC863JJ
What is the destination? France
What is the departure time? 1830.
The two flights are:
AC975 flight to France at 14:50, Air Canada
AC863 flight to France at 85:38, Air Canada
Are the two flights to the same destination?
yes
Note 1: You are to expect a perfect user who will always enter valid values; that is, do not verify
the validity of user input.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 5 steps with 7 images

Knowledge Booster
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
- shows the complete anagram.cpp program. Use a class to represent the word to be anagrammed. Member functions of the class allow the word to be displayed, anagrammed, and rotated. The main() routine gets a word from the user, creates a word object with this word as an argument to the constructor, and calls the anagram() member function to anagram the word. Don't copy old bartleby answer its wrongarrow_forwardProgram Specifications Write a FancyCar class to support basic operations such as drive, add gas, honk horn and start engine. fancy_car.py is provided with function stubs. Follow each step to gradually complete all instance methods. Note: This program is designed for incremental development. Complete each step and submit for grading before starting the next step. Only a portion of tests pass after each step but confirm progress. The main program includes basic calls to the instance methods. Add statements in the main program as instance methods are completed to support development mode testing. **Step 0: Complete the constructor to initialize the model and miles per gallon (MPG) with the values of the parameters. Initialize the odometer to five miles and the tank to be full of gas. By default, the model is initialized to "Old Clunker", and MPG is initialized to 24.0. Note the provided constant variable indicates the gas tank capacity of 14.0 gallons. Step 1 Complete the instance…arrow_forwardIn C++ write the definition of the class professorType, inherited from the class personType, defined in Chapter 10, with an additional data member to store a professor’s highest degree. Add appropriate constructors and member functions to initialize, access, and manipulate the data members. Write a test program to initialize, access, and manipulate the data members. For example, the mathProfessor holds a Doctorate degree.arrow_forward
- Implement a nested class composition relationship between any two class types from the following list: Advisor Вook Classroom Department Friend Grade School Student Teacher Tutor Write all necessary code for both classes to demonstrate a nested composition relationship including the following: a. one encapsulated data member for each class b. inline default constructor using constructor delegation for each class c. inline one-parameter constructor for each class d. inline accessors for all data members e. inline mutators for all data membersarrow_forwardJava Type the set up for a Class named Student with the following data fields, name, idNumber, gpa, address, and age. Include get and set methods for each data field.arrow_forwardUse java programming properties to write all the necessary classes and/or interfaces for a solution to the problem. Focus on class structure and interaction. You may implement your solution however you wish, but you will be graded on the appropriateness of your solution to the requirements. Note the use of capitalization and parentheses for clarification. You may use whatever constructors or additional methods you wish. Define a structure that can represent Animals. Animals have two behaviors; they can speak() and they can move(). By default, when an animal moves, the text ”This animal moves forward” is displayed. By default, when an animal speaks, the text ”This animal speaks” is displayed. A general Animal should not be able to be instantiated. Define two classes, Goose and Lynx, that are Animals. Both Goose and Lynx behave such that where “Animals” is displayed in speak() or move(), “goose” or “lynx” is displayed by the appropriate classes. Finally, any instance of Goose can fly(),…arrow_forward
- Instructions-Java Assignment is to define a class named Address. The Address class will have three private instance variables: an int named street_number a String named street_name and a String named state. Write three constructors for the Address class: an empty constructor (no input parameters) that initializes the three instance variables with default values of your choice, a constructor that takes the street values as input but defaults the state to "Arizona", and a constructor that takes all three pieces of information as input Next create a driver class named Main.java. Put public static void main here and test out your class by creating three instances of Address, one using each of the constructors. You can choose the particular address values that are used. I recommend you make them up and do not use actual addresses. Run your code to make sure it works. Next add the following public methods to the Address class and test them from main as you go: Write getters and…arrow_forwardHi, I am having trouble with this homework question for my C++ course 1. Implement a Student class. a. Create a class Student with the following private data members:1. name2. exam_1 grade3. exam_2 gradeb. Create all appropriate accessor and mutator functions.c. Assign appropriate access modifiers to insure encapsulation.d. Add a private calc GPA() function that calculates and returns the GPAbased upon the two exam grades.e. Add a public getGrade() function that: 1. Obtains the GPA from the private calc GPA() function.2. Returns a letter grade based upon the numerical GPA value.90 to 100 = A80 to 90 = B70 to 80 = C60 to 70 = D0 to 60 = F f. Test all functions use following main.int main(){Student a;a.setName("David");a.setExam1(90);a.setExam2(80);cout<<a.getName()<<endl;cout<<a.getExam1()<<endl;cout<<a.getExam2()<<endl;cout<<a.getGrade()<<endl;}arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

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)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education