You are creating a program for the owner of a small museum. They charge $10 for adults, $8 for seniors, and $5 for children. Ask the owner to enter the # of tickets (of each type) sold that day and then calculate both the total per ticket type and the grand total for the day. All user input should occur in one line.
Output:
How many Adult, Senior, and Child tickets were sold today? (separate numbers using spaces): [assume input is 10 10 10]
Revenue from Adult ticket sales is $100
Revenue from Senior ticket sales is $80
Revenue from Child ticket sales is $50
Total revenue for today is $230
#include <iostream>
using namespace std;
int main()
{
int a, s, c;
cout << "How many Adult, Senior, and Child tickets were sold today?\n";
cin >> a >> s >> c;
a = a * 10;
s = s * 8;
c = c * 5;
cout << "Revenue from Adult ticket sales is $" << a << endl;
cout << "Revenue from Senior ticket sales is $" << s << endl;
cout << "Revenue from Child ticket sales is $" << c << endl;
cout << "Total revenue for today is $" << a + s + c<<endl;
return 0;
}
Comments
Leave a comment