
// main module
Module main()
// Local variables
Declare Integer countA, manyA=300, rateA=20
Declare Integer countB, manyB=500, rateB=15
Declare Integer countC, manyC=200, rateC=10
// Get count A
Set countA = getSeats(“A”, manyA)
// Get count B
Set countB = getSeats(“B”, manyB)
// Get count C
Set countC = getSeats(“C”, manyC)
// Show income
Call showIncome(countA, rateA, countB, rateB, countC, rateC)
End Module
// The getSeats function gets number of seats sold
Function Integer getSeats(String Which, Integer most)
Declare Integer inputAmount
// enter count
Display “Enter number of “, Which, “ seats sold: “
Input inputAmount
// validate rate
While inputAmount < 0 OR inputAmount > most
Display “Quantity must be between 0 and “,most, “!”
Display “Enter a valid quantity.”
Input inputAmount
End While
return inputAmount
End Function
// The showIncome module shows income from sales of seats
Module showIncome(Integer countA, rateA, countB, rateB, countC, rateC)
Declare Integer totalIncome = 0, totalSection
Set totalSection = countA * rateA
Set totalIncome = totalIncome + totalSection
Display “Income from “, countA, “ section A seats is $”, totalSection
Set totalSection = countB * rateB
Set totalIncome = totalIncome + totalSection
Display “Income from “, countB, “ section B seats is $”, totalSection
Set totalSection = countC * rateC
Set totalIncome = totalIncome + totalSection
Display “Income from “, countC, “ section C seats is $”, totalSection
Display “Total Income is $”, totalIncome
End Module
Flowchart please

Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images

- (-465)10 + (325)10 = ?arrow_forwardWhat is the advantage of sending arguments by reference rather than value? When and why should an item be sent by reference?arrow_forwardQ1 function myFunc() { let a = 10; if (true) { Q3 } } let a = 5; console.log(a); Q4 console.log(a); Q2 const square = num => num * num; console.log(square(3) + 5); myFunc(); let x = 30; let y "200"; console.log(x+y); const nums = [10, 20, 8, 17]; nums.filter(e=> e > 10); console.log(nums); Q5 const nums = [30, 35, 42, 20, 15]; console.log(nums.every (num => num > 20)); January 15arrow_forward
- When a procedure takes both stack arguments and local variables, what phrases should be included in the procedure's epilogue?arrow_forwardC++ Programmingarrow_forwardint x1 = 66; int y1 = 39; int d; _asm { } mov EAX, X1; mov EBX, y1; push EAX; push EBX; pop ECX mov d, ECX; What is d in decimal format?arrow_forward
- C++ Coding: ArraysTrue and False Code function definitions for eoNum() and output(): Both eoNum() and output() are recursive functions. output() stores the even/odd value in an array. Store 0 if the element in the data array is even and store 1 if the element in the data array is odd. eoNum() displays all the values in an array to the console.arrow_forwardComputer Science Part C: Interactive Driver Program Write an interactive driver program that creates a Course object (you can decide the name and roster/waitlist sizes). Then, use a loop to interactively allow the user to add students, drop students, or view the course. Display the result (success/failure) of each add/drop.arrow_forwardint main(){ long long int total; long long int init; scanf("%lld %lld", &total, &init); getchar(); long long int max = init; long long int min = init; int i; for (i = 0; i < total; i++) { char op1 = '0'; char op2 = '0'; long long int num1 = 0; long long int num2 = 0; scanf("%c %lld %c %lld", &op1, &num1, &op2, &num2); getchar(); long long int maxr = max; long long int minr = min; if (op1 == '+') { long long int sum = max + num1; maxr = sum; minr = sum; long long int res = min + num1; if (res > maxr) { max = res; } if (res < minr) { minr = res; } } else { long long int sum = max * num1; maxr = sum; minr = sum; long long int res = min * num1;…arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY





