diff options
| author | Tim Pearse <[email protected]> | 2022-11-30 20:10:42 -0800 |
|---|---|---|
| committer | Tim Pearse <[email protected]> | 2022-11-30 20:10:42 -0800 |
| commit | ec586bca421aa7bf76433edcccf7035cf7270245 (patch) | |
| tree | 2264281e69c586230b6d044693023a91b1b8f260 | |
| parent | Added file orginization for ease (diff) | |
| download | cst116-lab3-legokid1503-ec586bca421aa7bf76433edcccf7035cf7270245.tar.xz cst116-lab3-legokid1503-ec586bca421aa7bf76433edcccf7035cf7270245.zip | |
This is the last version. Extra pushes will be done after to be cool, and get the pushes up to ten
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index 0d0aa7b..f37a240 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -92,8 +92,9 @@ void Output_Extra_Stats(int total_people, double fares[50]) { for (int i = 0; i < 50; i++) { total_fares += fares[i]; } - int average_cost_per_person = total_fares / total_people; - + double average_cost_per_person = total_fares / total_people; + average_cost_per_person = ceil(average_cost_per_person * 100.0) / 100.0; + //Prints the People transported, total paid, and average cost per person. cout << endl; cout << "People Transported: " << total_people << endl; |