Kindly Solve this C++ question as per the instructions. Please don't use any advanced code and copy other solutions.   Thank you so much for your help!   Instructions: (Use Visual Studio '22) 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

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Kindly Solve this C++ question as per the instructions. Please don't use any advanced code and copy other solutions.
 
Thank you so much for your help!
 
Instructions: (Use Visual Studio '22)
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"
  • printinfo function which prints out the flight information in the following format:
    (Name> flight to Destination> at <hour): (minute).
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: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).
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.
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
steps

Step by step

Solved in 6 steps with 7 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

Thank you for your help but this code doesn't run in visual studio. I am attaching screenshots of the errors. Please provide a simplified version of the code that can be run in visual studio. Thank you!

Instructions: (Use Visual Studio '22)
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"
  • printinfo function which prints out the flight information in the following format:
    (Name> flight to Destination> at <hour): (minute).
Error List + main.cpp* X Flight.h*
using namespace std;
int main()
[
// create two flight objects
Flight flights[2];
Flight.cpp*
(Global Scop
// declare variables
string flightName, flightDestination, departure Time;
for (int index = 0; index < 2; index++) {
// get input of flight details from user
cout << "What flight are you looking for?
getline (cin, flightName);
cout << "What is the destination? ";
getline (cin, flight Destination);
cout << "What is the departure time? ";
getline(cin, departureTime);
int hour = stoi(departure Time) / 100;
Transcribed Image Text:Error List + main.cpp* X Flight.h* using namespace std; int main() [ // create two flight objects Flight flights[2]; Flight.cpp* (Global Scop // declare variables string flightName, flightDestination, departure Time; for (int index = 0; index < 2; index++) { // get input of flight details from user cout << "What flight are you looking for? getline (cin, flightName); cout << "What is the destination? "; getline (cin, flight Destination); cout << "What is the departure time? "; getline(cin, departureTime); int hour = stoi(departure Time) / 100;
Error List
main.cpp*
Flight.h*
Flight::Flight(string name, string destination, int hour, int minute) {
this->name = name;
this->destination = destination;
this->hour = hour;
this->minute = minute;
// accessors
Estring Flight::getFlightName() {
return name;
Estring Flight::getFlightDestination () {
return destination;
}
Fint Flight::getTime() {
Flight.cpp* X
↓ Flight
string tm = to_string(hour) + to_string(minute);
return stoi(tm);
Transcribed Image Text:Error List main.cpp* Flight.h* Flight::Flight(string name, string destination, int hour, int minute) { this->name = name; this->destination = destination; this->hour = hour; this->minute = minute; // accessors Estring Flight::getFlightName() { return name; Estring Flight::getFlightDestination () { return destination; } Fint Flight::getTime() { Flight.cpp* X ↓ Flight string tm = to_string(hour) + to_string(minute); return stoi(tm);
Solution
Bartleby Expert
SEE SOLUTION
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY