-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPackage_main.cpp
More file actions
31 lines (27 loc) · 1.37 KB
/
Package_main.cpp
File metadata and controls
31 lines (27 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// 12191706 ±èÁ¤Áø
// Test program that creates objects of each type of Package and tests member function calculateCost.
#include <iostream>
#include <iomanip>
#include "Package.h"
#include "OvernightPackage.h"
#include "TwoDayPackage.h"
using namespace std;
int main() {
// creates basepackage object and tests member function calculateCost.
Package basepackage{ "Faker", 1234, "Seoul", "SKT", "T1", "Nuguri", 5678, "Incheon", "Damwon", "DW", 100, 0.1 };
cout << fixed << setprecision(2);
cout << "Basepackage inforamation has been created!\n"
<< "Package's weight is 100 ounce.\n"
<< "Cost per weight is 0.1\n"
<< "Calculated Cost is : " << basepackage.calculateCost() << "\n\n";
// creates tdpackage object and tests member function calculateCost.
TwoDayPackage tdpackage{ "Khan", 1357, "Berlin", "SKT", "T1", "TheShy", 2468, "Sanghai", "Invictus Gaming", "IG", 100, 0.1, 30 };
cout << "Twodaypackage information has been created!\n"
<< "Flat fee is 30\n"
<< "Calculated Cost is : " << tdpackage.calculateCost() << "\n\n";
// creates onpackage object and tests member function calculateCost.
OvernightPackage onpackage{ "Clid", 9876, "Seoul", "SKT", "T1", "Teddy", 5432, "Busan", "SKT", "T1", 100, 0.1, 0.2 };
cout << "Overnight information has been created!\n"
<< "Additional fee per ounce is 0.2\n"
<< "Calculated Cost is : " << onpackage.calculateCost() << "\n";
}