Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Start Initialize variables: highest _ cashier _ name = / / Initialize the name of the cashier with the highest number of customers
Start
Initialize variables:
highestcashiername Initialize the name of the cashier with the highest number of customers
highestcashiercustomers Initialize the highest number of customers served
lowestcashiername Initialize the name of the cashier with the lowest number of customers
lowestcashiercustomers infinity Initialize the lowest number of customers served to infinity to ensure any value will be
totalcashiers Initialize a counter for the total number of cashiers
totalsalary Initialize a variable to store the total salary of all cashiers
Input the number of cashiers totalcashiers
For to totalcashiers:
Input the name of the cashier cashiername
Input the basic salary of the cashier cashiersalary
Input the number of customers cashed by the cashier cashiercustomers
Add cashiersalary to totalsalary Accumulate the total salary
If cashiercustomers highestcashiercustomers:
Set highestcashiername to cashiername Update the name of the cashier with the highest customers
Set highestcashiercustomers to cashiercustomers Update the highest number of customers served
If cashiercustomers lowestcashiercustomers:
Set lowestcashiername to cashiername Update the name of the cashier with the lowest customers
Set lowestcashiercustomers to cashiercustomers Update the lowest number of customers served
Calculate the incentive for the cashier who cashed the most customers:
Set incentivepercentage Set the incentive percentage to
Set incentiveamount incentivepercentage totalsalary Calculate the incentive amount based on the total salary
Display:
"Cashier with the highest number of customers: highestcashiername"
"Salary of the cashier with the highest number of customers: basicsalary incentiveamount
"Cashier with the lowest number of customers: lowestcashiername"
"Salary of the cashier with the lowest number of customers: basicsalary"
"Total salary of all cashiers: totalsalary"
"Incentive amount: incentiveamount"
End
Question Can i get a trace table for the pascal program above. Thank you.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started