Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

We're programming in C and have to work backward from the flow chart. The OUL Wagner Theater has a three tiered pricing scheme. Section A

We're programming in C and have to work backward from the flow chart.

The OUL Wagner Theater has a three tiered pricing scheme. Section A seats cost $20 each, section B seats cost $15 each and section C seats cost $10 each. Student tickets are half the price of the regular tickets. Designed a program that allows the ticket seller to enter the number of regular tickets and student tickets sold in a section and display the total amount due from the customer. A customer can only buy seats in one section per transaction but the transaction may include both student and regular priced tickets.

When the agent has no more customers, he will enter X as the Section code. At the end of the program, display the total amount of sales.

Use a subfunction to calculate the amount due for each individual sale.

image text in transcribed

main() calcSales(Sectionin, Regulars, Students) TotalSales = 0 GET NumRegular, Num Student switch (Sectionin) do GET Section BaseAmt = 20.00 AmtDue = calcSale (Section NumRegular Num Student) BaseAmt = 15.00 while Section != 'X && Section != 'A & & Section != 'B' && Section != 'C' DISPLAY AmtDue Base Amt = 10.00 F while Section != 'X TotalSales + = AmtDue do GET Section Sale Amt = BaseAmt* Regulars 0.5 * BaseAmt Students DISPLAY TotalSales while Section != 'X & & Section != 'A && Section != 'B' && Section != 'C' return Sale Amt return 0 main() calcSales(Sectionin, Regulars, Students) TotalSales = 0 GET NumRegular, Num Student switch (Sectionin) do GET Section BaseAmt = 20.00 AmtDue = calcSale (Section NumRegular Num Student) BaseAmt = 15.00 while Section != 'X && Section != 'A & & Section != 'B' && Section != 'C' DISPLAY AmtDue Base Amt = 10.00 F while Section != 'X TotalSales + = AmtDue do GET Section Sale Amt = BaseAmt* Regulars 0.5 * BaseAmt Students DISPLAY TotalSales while Section != 'X & & Section != 'A && Section != 'B' && Section != 'C' return Sale Amt return 0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Continuous Auditing Theory And Application

Authors: David Y. Chan, Victoria Chiu

1st Edition

1787434141, 978-1787434141

More Books

Students also viewed these Accounting questions

Question

Why We Listen?

Answered: 1 week ago