This will compile and run, but after I enter tickets sold the Prompt close without displaying income generated.
hello guys, this is what I'm working on.
Theater Seating Revenue with Input Validation
A dramatic theater has three seating sections, and it charges the following prices for tickets in each section: section A seats cost $20 each, section B seats cost $15 each, and section C seats cost $10 each. The theater has 300 seats in section A, 500 seats in section B, and 200 seats in section C. Design a program that asks for the number of tickets sold in each section and then displays the amount of income generated from ticket sales. The program should validate the numbers that are entered for each section.
#include <string>
#include <istream>
#include <iostream>
#include <limits>
usingnamespace std;
int main(int argc, char* argv[])
{
int seca,secb,secc;
do
{
printf("Enter the number of tickets sold in section A\n");
scanf("%d",&seca);
if(seca>300)
printf("Invalid input");
} while(seca>300);
do
{
printf("Enter the number of tickets sold in section B\n");
scanf("%d",&secb);
if(secb>500)
printf("Invalid input");
} while(secb>500);
do
{
printf("Enter the number of tickets sold in section C\n");
scanf("%d",&secc);
if(secc>200)
printf("Invalid input");
} while(secc>200);
int totincome=(seca*20)+(secb*15)+(secc*10);
printf("Total income generated from ticket sales=$%d",totincome);
}