Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
