Professional Documents
Culture Documents
Labzakol 1
Labzakol 1
#include <iostream>
using namespace std;
int main() {
int testCase;
cin >> testCase;
char ID[12];
char company_name[20];
char company_airport[20];
int flight_hours;
int state;
if (testCase == 1) {
cout << "TESTING CONSTRUCTOR FOR AIRPLANE" << endl;
Airplane a;
cout << "TEST FOR DEFAULT CONSTRUCTOR PASSED" << endl;
Airplane a1("ZHN-96-TY", "FINKI-Airline", "TMF", 13);
cout << "TEST FOR CONSTRUCTOR WITH 3 ARGUMENTS PASSED" << endl;
Airplane a2("ZHN-96-TA", "FINKI1-Airline", "TMF", 13, 0);
cout << "TEST FOR CONSTRUCTOR WITH 4 ARGUMENTS PASSED" << endl;
} else if (testCase == 2) {
cout << "TESTING COPY-CONSTRUCTOR AND OPERATOR = (ASSIGNMENT) FOR AIRPLANE"
<< endl;
Airplane p("ZHN-96-TA", "FINKI-Airline", "TMF", 13, 0);
Airplane p1(p);
cout << "TEST FOR COPY CONSTRUCTOR PASSED" << endl;
Airplane p2;
p2 = p;
cout << "TEST FOR OPERATOR = (ASSIGNMENT) PASSED" << endl;
} else if (testCase == 3) {
cout << "TESTING PRINT() FOR AIRPLANE" << endl;
cin>>ID>>company_name>>company_airport>>flight_hours>>state;
Airplane p(ID, company_name, company_airport, flight_hours, state);
p.print();
} else if (testCase == 4) {
cout << "TESTING CONSTRUCTOR FOR AIRPORTSERVICE" << endl;
AirportService as("FINKI");
cout << "TEST PASSED" << endl;
} else if (testCase == 5) {
cout << "TESTING ADD() AND PRINT() FOR AIRPORTSERVICE" << endl;
AirportService as("FINKI");
int n;
cin>>n;
for(int i=0; i<n; i++){
cin>>ID>>company_name>>company_airport>>flight_hours>>state;
Airplane p(ID, company_name, company_airport, flight_hours, state);
as.addAirplane(p);
}
as.print();
} else if (testCase == 6) {
cout << "TESTING serviceOldestAirplane() AND PRINT() FOR AIRPORTSERVICE" <<
endl;
AirportService as("FINKI");
int n;
cin>>n;
for(int i=0; i<n; i++){
cin>>ID>>company_name>>company_airport>>flight_hours>>state;
Airplane p(ID, company_name, company_airport, flight_hours, state);
as.addAirplane(p);
}
Airplane p = as.serviceOldestAirplane();
cout<<"Removed plane:"<<endl;
p.print();
cout<<"-----------------"<<endl;
as.print();
} else if (testCase == 7) {
cout << "TESTING COPY CONSTRUCTOR AND OPERATOR = FOR AIRPORTSERVICE" <<
endl;
AirportService as("FINKI");
Airplane a1("ZHN-96-TY", "FINKI-Airline", "TMF", 13);
as.addAirplane(a1);