dd to the flowchart from Assignment 3.Have a loop so that it can process multiple customers.Output the amount each person has to pay and the total revenue for the day.Trace the program, make up your own data.Show the data at the top of the page. Make sure you trace with at least 3 people
Question
dd to the flowchart from Assignment 3.Have a loop so that it can process multiple customers.Output the amount each person has to pay and the total revenue for the day.Trace the program, make up your own data.Show the data at the top of the page. Make sure you trace with at least 3 people
Solution
It seems like you're asking for help with a programming assignment. Here's a general idea of how you might approach this:
- Adding a loop to process multiple customers: You can use a loop structure like a
forloop or awhileloop. This loop will continue to process customers until a certain condition is met. For example, you might have a list of customers and loop through each one.
customers = ['Customer1', 'Customer2', 'Customer3']
for customer in customers:
# Process each customer
- Outputting the amount each person has to pay and the total revenue for the day: You'll need to keep track of the total revenue and the amount each person has to pay. You can do this with variables that you update inside your loop.
total_revenue = 0
for customer in customers:
# Calculate the amount the customer has to pay
amount_to_pay = calculate_amount(customer)
print(f'{customer} has to pay {amount_to_pay}')
total_revenue += amount_to_pay
print(f'Total revenue for the day is {total_revenue}')
- Tracing the program with your own data: To trace the program, you can add print statements at key points in your code to output the current state of your variables. This will help you understand how your code is working and where any potential issues might be.
total_revenue = 0
for customer in customers:
# Calculate the amount the customer has to pay
amount_to_pay = calculate_amount(customer)
print(f'Processing {customer}')
print(f'{customer} has to pay {amount_to_pay}')
total_revenue += amount_to_pay
print(f'Total revenue so far is {total_revenue}')
print(f'Total revenue for the day is {total_revenue}')
- Showing the data at the top of the page: This will depend on how you're running your program. If you're using a notebook like Jupyter, you can simply add a cell at the top of your notebook to display your data. If you're running a script, you might want to print out your data at the start of your script.
print(f'Starting with the following customers: {customers}')
Remember to replace calculate_amount(customer) with your own function or calculation for determining how much each customer has to pay.
Similar Questions
Have the student enter the number of classes they are taking.For each class the student is going to buy a notebook that costs $1.50.The student is also going to buy a package of pencils that costs 4.00.There is tax of 10%.Output the total cost of buying items for the class.Trace the flowchart twice: once with 2 classes and once with 5 classes.
Can you draw a data flow diagram for distributing soft drink cannisters?
Draw a flowchart that will calculate the price of building a house. The price of the house is based on three things:The quality of the interiorThe lot sizeThe size of the houseThe realtor enters the number for each item, not the name. The clerk will not enter the numbers that they can’t control such as the prices. For example: everyone who buys a custom home pays $1000 for each 500 square feet of lot and $500 for each 100 square feet of house.Output the cost for one person buying a house. People may only buy one house.Trace the program 3 times: once for each type of home, make up your own data.Data Related to Quality and Size of HouseQuality of house Type of house Price per 500 sq. ft of lot Price per 100 sq. ft of house1 Custom Home $1000 $5002 Mid-quality $700 $4003 Economy $500 $300
Use the data shown to answer the questions that follow.Person Minutes Shopping in the Store Amount Spent on Groceries at Checkout1 46.5 140.52 55 1683 78.8 241.44 91.4 209.25 98.9 300.76 96.7 291.17 60.1 182.38 81.4 245.2Copy and paste the above data into Excel and make the most appropriate graph for these data. Make sure the x-axis represents the "Minutes Shopping in the Store" and that the y-axis represents the "Amount Spent on Groceries at Checkout."One of the values in the plot of this data does not fit the pattern of the other values. It would be called an outlier.What is the x-value and y-value of the outlier?Hint: If you hover your mouse over the points in your Excel graph it will show you the exact x-value and y-value of the point.Group of answer choices(46.5, 140.5)(55, 168)(78.8, 241.4)(91.4, 209.2)(98.9, 300.7)(96.7, 291.1)(60.1, 182.3)(81.4, 245.2)
Write an algorithm and draw a flowchart to show the steps of ATMcash withdrawal.
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.