diff options
| author | jacobdw22 <[email protected]> | 2022-11-28 19:31:37 -0800 |
|---|---|---|
| committer | jacobdw22 <[email protected]> | 2022-11-28 19:31:37 -0800 |
| commit | 5479d69938f350f4cdc7c1c67867a967a69c9cb1 (patch) | |
| tree | a4153e0e72340700e02d579b54616ff789fb4f6d | |
| parent | Abbreviated the headers to make it look neater (diff) | |
| download | cst116-lab3-jacobdw22-5479d69938f350f4cdc7c1c67867a967a69c9cb1.tar.xz cst116-lab3-jacobdw22-5479d69938f350f4cdc7c1c67867a967a69c9cb1.zip | |
Added average cost per person
| -rw-r--r-- | BlankConsoleLab/cst116-lab3-wilson.cpp | 24 |
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 |