Question: need help with c++ complete the TODO assignment in Lab14.cpp Lab14.cpp #include #include using namespace std; class Movie { public : Movie(string name =
need help with c++
complete the TODO assignment in Lab14.cpp
Lab14.cpp
#include
#include
using namespace std;
class Movie
{
public:
Movie(string name = " ", int min = 0) {
setData(name, min);
}
void setData(string name, int min) {
movieName = name;
length = min;
}
void printData() const {
cout
}
string getMovieName() const {
return movieName;
}
int getMinutes() const {
return length;
}
private:
string movieName;
int length;
};
// TODO: Overload the operators >, >=,
// Ensure support for comparing Flight objects to Flight objects,
// Flight objects to Movie objects, and Movie objects to Flight objects.
// 12 functions in total
class Flight {
public:
Flight(int flightNum = 0, int min = 0) {
setData(flightNum, min);
}
void setData(int flightNum, int min) {
flightNumber = flightNum;
length = min;
}
void printData() const {
cout
}
int getMinutes() const {
return length;
}
int getFlightNumber() const {
return flightNumber;
}
private:
int flightNumber;
int length;
};
int main() {
Flight f1(1298, 101);
Flight f2(9821, 125);
Movie m1("The Avengers", 101);
f1.printData();
f2.printData();
m1.printData();
if (m1 > f1)
cout
if (m1
cout
if (m1
cout
if (m1 > f2)
cout
if (f1 >= m1)
cout
if (f1
cout
if (f2
cout
if (f2 >= m1)
cout
if (f1 >= f2)
cout
return 0;
}
sample output:

Flight Number: 1219 Flight Duration: 134 minutes Flight Number: 9121 Flight Duration: 125 minutes Movie: Casablanca, Movie Duration: 134 minutes Casablanca is longer than Flight 9121 Flight 1219 is longer than or equal to Casablanca Flight 1219 is shorter than or equal to Casablanca Flight 9121 is shorter than or equal to Casablanca Flight 1219 is longer than or equal to Flight 9121 Program ended with exit code: 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
