#include <iostream>
    #include <iomanip>
    #include <fstream
    using namespace std;

    const char Avail = '#';
    const char Taken = '*';
    const int r = 15;
    const int c = 30; 
    char SEATS[r][c];

    int main()
        // Declarations for main
        ifstream inputPrices; 
        double seatPrices[15];
        int row;
        int column;
        double cost;
        int answer;
        int confirm; 
        int choice; 

Edited by Rachel Roxx

4 Years
Discussion Span
Last Post by mike_2000_17

The easiest is probably to simply keep a variable, call it totalSales, to which you add the cost of each ticket that is bought, as they are bought. So, after line 25, you can add:

double totalSales = 0.0;

Then, right after line 104, you can add this line:

totalSales += seatPrices[row-1];

And finally, between line 125 and 126, you can add this line:

cout << "         Total of sales so far: " << totalSales << endl;

And that should do it.

The more complicated solution would be to loop through all the seats and check if they are Taken, and if so, add the cost of that ticket to the sum total.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.