consolidate all repos to one for archive
This commit is contained in:
28
semester_2/programiranje_2/primeri/Example12/main.cpp
Normal file
28
semester_2/programiranje_2/primeri/Example12/main.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#include <iostream>
|
||||
#include "FlightTicket.h"
|
||||
#include "ReturnFlightTicket.h"
|
||||
|
||||
int main() {
|
||||
Date* ptrDate1 = new Date(17, 3, 2020);
|
||||
Date* ptrDate2 = new Date(18, 3, 2020);
|
||||
Date* ptrDate3 = new Date(19, 3, 2020);
|
||||
Date* ptrDate4 = new Date(29, 3, 2020);
|
||||
Date* ptrDate5 = new Date(31, 3, 2020);
|
||||
FlightTicket* ptrFlights[3];
|
||||
ptrFlights[0] = new FlightTicket(400, "Moskva", "Ljubljana", false, FlightTicketType::Economy, ptrDate1);
|
||||
ptrFlights[1] = new ReturnFlightTicket(1000, "Hong Kong", "Washington", true,
|
||||
FlightTicketType::FirstClass, ptrDate2, ptrDate4);
|
||||
ptrFlights[2] = new ReturnFlightTicket(800, "Vienna", "Chicago",
|
||||
false, FlightTicketType::Economy, ptrDate3, ptrDate5);
|
||||
for (int i=0; i<3; i++)
|
||||
std::cout << ptrFlights[i]->toString() << std::endl;
|
||||
delete ptrDate1;
|
||||
delete ptrDate2;
|
||||
delete ptrDate3;
|
||||
delete ptrDate4;
|
||||
delete ptrDate5;
|
||||
for (int i=0; i<3; i++)
|
||||
delete ptrFlights[i];
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user