Answered step by step
Verified Expert Solution
Link Copied!

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:
highest_cashier_name =""// Initialize the name of the cashier with the highest number of customers
highest_cashier_customers =?? Initialize the highest number of customers served
lowest_cashier_name =m????? Initialize the name of the cashier with the lowest number of customers
lowest_cashier_customers = infinity // Initialize the lowest number of customers served to infinity to ensure any value will be
total_cashiers =?? Initialize a counter for the total number of cashiers
total_salary =0?? Initialize a variable to store the total salary of all cashiers
Input the number of cashiers (total_cashiers)
For i=1 to total_cashiers:
4.1. Input the name of the cashier (cashier_name)
4.2. Input the basic salary of the cashier (cashier_salary)
4.3. Input the number of customers cashed by the cashier (cashier_customers)
4.4. Add cashier_salary to total_salary // Accumulate the total salary
4.5. If cashier_customers > highest_cashier_customers:
4.5.1. Set highest_cashier_name to cashier_name // Update the name of the cashier with the highest customers
4.5.2. Set highest_cashier_customers to cashier_customers // Update the highest number of customers served
4.6. If cashier_customers lowest_cashier_customers:
4.6.1. Set lowest_cashier_name to cashier_name // Update the name of the cashier with the lowest customers
4.6.2. Set lowest_cashier_customers to cashier_customers // Update the lowest number of customers served
Calculate the incentive for the cashier who cashed the most customers:
5.1. Set incentive_percentage =0.1?? Set the incentive percentage to 10%
5.2. Set incentive_amount = incentive_percentage * total_salary // Calculate the incentive amount based on the total salary
Display:
"Cashier with the highest number of customers: highest_cashier_name"
"Salary of the cashier with the highest number of customers: (basic_salary + incentive_amount)"
"Cashier with the lowest number of customers: lowest_cashier_name"
"Salary of the cashier with the lowest number of customers: basic_salary"
"Total salary of all cashiers: total_salary"
"Incentive amount: incentive_amount"
End
Question - Design and execute a trace table to test the logics of the algorithm above. You are expected to come up with the appropriate columns for your trace table. Also, you should provide your test data above the trace table.
image text in transcribed

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

Step: 3

blur-text-image

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

More Books

Students also viewed these Databases questions

Question

Understand how to combat sexual harassment in the workplace.

Answered: 1 week ago

Question

10. What is meant by a feed rate?

Answered: 1 week ago