PAYTHON PROGRAM WITHOUT ANY FUNCTION AND METHOD
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.
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.
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.
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
4. Code a condition controlled while loop around your counter controlled 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?
OUTPUT
Input Values 7 days of bottles:
350
640
520
420
600
310
900
Total number of bottles collected: 1,234
Payout for this transaction $123.45
Do you want to complete another transaction? Y
Input Values 7 days of bottles:
350
640
520
420
600
310
900
Total number of bottles collected: 1,234
Payout for this transaction $123.45
Do you want to complete another transaction? N
Process Complete
If you have any doubts, please give me comment...


Code:
DEPOSIT_PER_BOTTLE = 0.10
another = "Y"
while another=="Y":
print("Input Values 7 days of bottles:")
total = 0
for i in range(7):
collected_bottles = int(input())
total += collected_bottles
payout = total*DEPOSIT_PER_BOTTLE
print("Total number of bottles collected: {:,}".format(total))
print("Payout for this transaction $%.2f"%payout)
another = input("Do you want to complete another transaction? ").upper()
print("Process Complete")
PAYTHON PROGRAM WITHOUT ANY FUNCTION AND METHOD A program that will allow a grocery store to...
Complete the missing parts of java source code //This program calculates a running total. Here is the problem definition //Data Express, an Internet Service Provider, has requested that you develop a program to allow //sales representatives to calculate a running total of their sales based on a number of days. //The program prompts the salesperson “How many days do you have sales figures? “. //The number of days must be between 1 – 4 days (keep asking the user until...
Prepare pseudocode for a program that lets a user continuously enter numbers until the number 99 is entered. Once the user has stopped entering numbers, display the number of numbers entered AND the sum of those numbers. You'll need a counter and an accumulator for this . Make sure your loop is structured Don't forget to comment your code. Don't forget to display appropriate prompts when requesting input from the user. Use a NAMED CONSTANT for the constant in this...
Lab 5-2 Nested Loops 2. Summation Of Numbers (using Nested While Loops) Part A: The program will calculate and display the total of all numbers up to a specific number (entered by the user). Only positive numbers are allowed. Part B: User-controlled loop Part A Input Validation loop Part A: Summation loop Examples: When 5 is entered the program will calculate the total as 1+2+...+5 and display 15. When 2 is enterered the program will calculate the total as 1+2...
In python 3, 1. Write a program that takes a number of credit hours and returns a classification as follows: 29 credits or less: freshman; 30-59 credits: sophomore; 60-89 credits: junior; 90+ credits: senior. 2. Use a loop to valid input such that users can only enter positive numbers. 3. Use a loop to allow the user to keep entering credit hours and receiving classifications until they quit. All code must be in a function. I suggest the following structure:...
Prepare pseudocode for a program that lets a user continuously enter numbers until the number 99 is entered. Once the user has stopped entering numbers, display the number of numbers entered AND the sum of those numbers. You'll need a counter and an accumulator for this (see pp. 179-181 and 205-208). Make sure your loop is structured (see priming input in figure 3-16). Don't forget to comment your code. Don't forget to display appropriate prompts when requesting input from the...
A bug collector collects bugs every day for five days. Write a program that keeps a running total of the number of bugs collected during the five days. The while loop should ask for the number of bugs collected for each day, and when the while loop is finished, the program should display the total number of bugs collected. using a while loop!!!!!!!!! not loop. Write the code in python !!!!!!!
Python homework problem First: Write a program (using a loop with break) to allow a user to input an integer and determine if the integer is prime. Then change the program to examine a number of integers to determine if each is prime. The program should allow the user to input the number of integers (say n) to be checked to determine if each is prime. Then the user should input n integers and print whether each of the integers...
It’s almost election day and the election officials need a program to help tally election results. There are two candidates for office—Polly Tichen and Ernest Orator. The program’s job is to take as input the number of votes each candidate received in each voting precinct and find the total number of votes for each. The program should print out the final tally for each candidate—both the total number of votes each received and the percent of votes each received. Clearly...
It's almost election day and the election officials need a program to help tally election results. There are two candidates for office—Polly Tichen and Ernest Orator. The program's job is to take as input the number of votes each candidate received in each voting precinct and find the total number of votes for each. The program should print out the final tally for each candidate—both the total number of votes each received and the percent of votes each received. Clearly...
PYTHON CODE First Code: Write a program that uses a text file to store the daysand hours that a user worked in a week. The program should begin by prompting for the number of days worked in the week. It should continue with a loop for input of the days and hours and for writing these to the file, each on its own line. Sample Output (inputs shown in boldface) How many days did you work this week? 5 Enter...