Chapter 4 Lab Python This lab requires you to write a complete program using a condition-controlled loop, a counter-controlled loop, and an accumulator. The program is as follows: Write a program that...


Chapter 4 Lab Python This lab requires you to write a complete program using a condition-controlled loop, a counter-controlled loop, and an accumulator.


The program is as follows: Write a program that will allow a grocery store to keep track of the total number of bottles collected for a seven-day period.


The program should allow the user to enter the number of bottles returned for each day of the seven-day period. The program will accumulate the total number of bottles returned for the 7-day period.


Then calculate the amount paid out (the total bottles returned times .10 cents).


The output (display) of the program should include the total number of bottles returned and the total paid out.


Allow the user to enter multiple transactions.


Step 1: Code the named constants needed to complete the process. Use a named constant for the deposit per bottle and for the sentinel for the condition-controlled loop.


Step 2: Code a counter-controlled loop for accumulating the total number of bottles returned each day (7 days).


Prompt the user for the number of bottles collected, Enter number of Bottles returned for day n.


Note: Replace the n with the counter. Add the user input to the accumulator for total number of bottles.


Step 3: Calculate the payout and display the results (notice the format() ): Payout = total number of bottles collected * DEPOSIT_PER_BOTTLE Total number of bottles collected: n,nnn Payout for this transaction $ n,nnn.nn


Step 4: Code a condition controlled while loop around your countercontrolled loop.


You will need to reset the bottle accumulator so you can begin over again with the next transaction.


Prompt the user to continue – Do you want to complete another transaction? 2 Now, your program using the following values.


If there is an error, go back through the steps to locate the problem.


Input Values Seven days of bottles:
346
238
638
890
1035
899
536


Total number of bottles collected: 4,582


Payout for this transaction: $458.20


Do you want to complete another transaction? y


Input Values Seven days of bottles:
123
526
52
480
9951
324
789


Total number of bottles collected: 12,245


Payout for this transaction $1,224.50


Do you want to complete another transaction? n


Process Complete

Oct 05, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here