Question

There are three seating categories at a stadium. For a softball game, Class A seats cost...

There are three seating categories at a stadium. For a softball game, Class A seats cost $15, Class B seats cost $12, and Class C seats cost $9. Write a program that asks how many tickets for each class of seats were sold, then displays the amount of income generated from ticket sales. Format your dollar amount in a fixed-point notation with two decimal points and make sure the decimal point is always displayed. (Write for C++ code ony please)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int A,B,C; //To store class A,B and C tickets sold respectively
cout<<"Enter class A seats sol"<<endl;
cin>>A;
cout<<"Enter class B seats sol"<<endl;
cin>>B;
cout<<"Enter class C seats sol"<<endl;
cin>>C;
cout<<"Total amount of income generated from the sale:";
cout<<fixed<<setprecision(2)<<A*15.0+B*12+C*9; //used to display decimal values up to 2 decimal
cout<<endl;
}

sai@sai-Lenovo-G50-80:~/C$ g++ -o userInput userInput.cpp
sai@sai-Lenovo-G50-80:~/C$ ./userInput
Enter class A seats sol
12
Enter class B seats sol
12
Enter class C seats sol
12
Total amount of income generated from the sale:432.00

Add a comment
Know the answer?
Add Answer to:
There are three seating categories at a stadium. For a softball game, Class A seats cost...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • There are three seating categories at a stadium. For a softball game, Class A seats cost...

    There are three seating categories at a stadium. For a softball game, Class A seats cost $15, Class B seats cost $12, and Class C seats cost $9. Write a program that asks how many tickets for each class of seats were sold, then displays the amount of income generated from ticket sales. Format your dollar amount in fixed-point notation, with two decimal places of precision, and be sure the decimal point is always displayed. Using the following test data:...

  • Can anyone help me with this? Stadium Seating There are three seating categories at the Broward...

    Can anyone help me with this? Stadium Seating There are three seating categories at the Broward College Stadium. For a softball game, student tickets cost $9.00, senior tickets cost $12.00 and general tickets cost $15.00. Write a program that asks how many tickets for each class of seats were sold. Then display the total number of tickets sold, the amount of income generated from each class and the total ticket sales. For the program: Create pseudocode as a .txt file....

  • In Python There are 3 seating categories at a stadium. Class A seats cost $20, class...

    In Python There are 3 seating categories at a stadium. Class A seats cost $20, class B cost $15, and class C $10. Write a program that asks how many tickets for each class of seats were sold, then displays the amount of income generated from tickets sales. This program should have main, calcIncome, and showIncome functions. Main function should get number of seats sold for each category and sent to calcIncome. calcIncome calculates income for each category, the return...

  • How would you code this in Python3? Instructions from your teacher: There are three seating categories...

    How would you code this in Python3? Instructions from your teacher: There are three seating categories at a stadium. Class A seats cost $20, Class B seats cost $15, and Class C seats cost $10. Write a program that asks how many tickets for each class of seats were sold, then displays the amount of income generated from ticket sales.

  • create Stadium Seating visual basic

    There are three seating categories at an athletic stadium. For a baseball game, Class A seats cost $15 each, Class B seats cost $12 each, and Class C seats cost $9each. Create an application that allows the user to enter the number of tickets sold for each class. The application should be able to display the amount of incomegenerated from each class of ticket sales and the total revenue generated.Use the following test data to determine if the application is...

  • 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 seatscost $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 aprogram 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 validatethe numbers...

  • Please help me develop executable code in C++: //The manager of a football stadium wants you...

    Please help me develop executable code in C++: //The manager of a football stadium wants you to write a program that calculates the total ticket //sales after each game. There are four types of tickets sold: box, sideline, premium, //and general admission. //After each game, the data is stored in a file in the following form: //ticketPrice numberofTicketsSold //... //Sample data are shown below: //250 5750 //100 28000 // 50 35750 // 25 18750 //The first line indicates that the...

  • this is for java class Define a utility class for displaying values of type double. Call...

    this is for java class Define a utility class for displaying values of type double. Call the class DoubleOut. Include all the methods from the class DollarFormat in Listing 6.14, all the methods from the class OutputFormat of Self-Test Question 30, and a method called scienceWrite that displays a value of type double using e notation, such as 2.13e–12. (This e notation is also called scientific notation, which explains the method name.) When displayed in e notation, the number should...

  • P7.5– A theater seating chart is implemented as a two-dimensional array of ticket prices, like this:...

    P7.5– A theater seating chart is implemented as a two-dimensional array of ticket prices, like this: 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 20 20 20 20 20 20 10 10 10 10 20 20 20 20 20 20 10 10 10 10 20 20 20 20 20 20 10 10 20 20 30 30...

  • this is for c++ please and thank you! 19. Check Writer Write a program that displays...

    this is for c++ please and thank you! 19. Check Writer Write a program that displays a simulated paycheck. The program should ask the user to enter the date, the payee's name, and the amount of the check (up to $10,000). It should then display a simulated check with the dollar amount spelled out, as shown here: Date: 11/24/2014 Pay to the Order of: John Phillips $1920.85 One thousand nine hundred twenty and 85 cents Be sure to format the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT