summaryrefslogtreecommitdiff
path: root/BlankConsoleLab/cst116-lab3-wilson.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'BlankConsoleLab/cst116-lab3-wilson.cpp')
-rw-r--r--BlankConsoleLab/cst116-lab3-wilson.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/BlankConsoleLab/cst116-lab3-wilson.cpp b/BlankConsoleLab/cst116-lab3-wilson.cpp
index 3d027fb..3377a84 100644
--- a/BlankConsoleLab/cst116-lab3-wilson.cpp
+++ b/BlankConsoleLab/cst116-lab3-wilson.cpp
@@ -204,17 +204,25 @@ void PrintTotalsAndSummary(ofstream& outFile, int totalRecords, int psgr[], int
{
// To screen
cout << "\n\t** People Transported: "
- << NumPsgr(psgr, num_psgr, totalRecords) << " **\n"; //Prints the total records to the screen
+ << NumPsgr(psgr, num_psgr, totalRecords)
+ << " **\n"; //Prints the total records to the screen
cout << "\n\t** Total Paid (rounded down to nearest dollar): "
- << TotalPaid(fare, toll, total_fare, totalRecords) << " **\n"; //Prints the total paid (all fares and tolls) to the screen
-
- cout << "\t\t The End \n"; //Prints The End to the screen
+ << TotalPaid(fare, toll, total_fare, totalRecords)
+ << " **\n"; //Prints the total paid (all fares and tolls) to the screen
+ cout << "\n\t** Average Cost Per Person(Rounded down to nearest dollar: "
+ << TotalPaid(fare, toll, total_fare, totalRecords) / NumPsgr(psgr, num_psgr, totalRecords)
+ << "**\n"; //Prints the average cost per person to the screen
+ cout << "\t\t The End \n"; //Prints "The End" to the screen
// To file
outFile << "\n\t** People Transported: "
- << NumPsgr(psgr, num_psgr, totalRecords) << " **\n"; //Prints the total records to the out file
+ << NumPsgr(psgr, num_psgr, totalRecords)
+ << " **\n"; //Prints the total records to the out file
outFile << "\n\t** Total Paid (rounded down to nearest dollar): "
- << TotalPaid(fare, toll, total_fare, totalRecords) << " **\n"; //Prints the total paid (all fares and tolls) to the out file
-
- outFile << "\t\t The End \n"; //Prints The End to the out file
+ << TotalPaid(fare, toll, total_fare, totalRecords)
+ << " **\n"; //Prints the total paid (all fares and tolls) to the out file
+ outFile << "\n\t** Average Cost Per Person(Rounded down to nearest dollar: "
+ << TotalPaid(fare, toll, total_fare, totalRecords) / NumPsgr(psgr, num_psgr, totalRecords)
+ << "**\n"; //Prints the average cost per person to the out file
+ outFile << "\t\t The End \n"; //Prints "The End" to the out file
} \ No newline at end of file