Question

A bug collector collects bugs every day for five days. Write a program that keeps a...

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 !!!!!!!

0 0
Add a comment Improve this question Transcribed image text
Answer #1
total = 0

i = 1
while i <= 5:
    total += int(input("Enter number of bugs collected on day " + str(i) + ": "))
    i += 1

print("Total number of bugs collected is " + str(total))
Add a comment
Know the answer?
Add Answer to:
A bug collector collects bugs every day for five days. Write a program that keeps a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • A bug collector collects bugs every day for one week (7 days). Write a program that...

    A bug collector collects bugs every day for one week (7 days). Write a program that asks the user for the total number of bugs they collected for each day and stores each number in a list. Use a loop to calculate the total number of bugs and display the result.      (Python)

  • Write the program in IDLE: Write a program that keeps tracks of weekly earnings for a...

    Write the program in IDLE: Write a program that keeps tracks of weekly earnings for a stock trader. Using a loop, ask the trader to enter his earnings for days 1 to 5. Calculate and display the total POSITIVE earnings for the week. Calculate and display the total NEGATIVE earnings for the week. Calculate and display the total earnings for the week. Format your output to two decimal places.

  • USE of C++ please Write a program that achieves the following requirements: 1. A while/do-While loop...

    USE of C++ please Write a program that achieves the following requirements: 1. A while/do-While loop that will ask the user to input an integer on each iteration. The loop keeps a running total of the input and exits only when the total exceeds the first input times 10. 2. A for loop that does the exact same thing. The program should print out the *new* total each time the total is input.

  • Write a program that calculates the calories burned while running over a given number of miles....

    Write a program that calculates the calories burned while running over a given number of miles. While several factors determine how many calories are burned during a mile run, for this program, 90 calories are burned for every mile of running. The cumulative calories burned during a run can be calculated as: Calories * Distance For example, if a person runs 5 miles, the total calories burned is 450. After 3 hours, the person has burned 2 calories. The program...

  • Using the Phyton program; Write a program using loop (use days of the week as a...

    Using the Phyton program; Write a program using loop (use days of the week as a list) to ask the user to enter the total hours spend studying for each day of the week. How many hours spent studying on Monday? How many hours spent studying on Tuesday? Count and display the number of days the user 1) studied less than 4 hours. 2) studied between 4- 8 hours 3) studied more than 8 hours

  • Write a program using Python that calculates the amount of money a person would earn over...

    Write a program using Python that calculates the amount of money a person would earn over a period of time if his or her salary is one penny the first day, two pennies the second day, and continues to double each day. The program should ask the user for the number of days. Display a table showing what the salary was for each day, then show the total pay at the end of the period. The output should be displayed...

  • Python Computer Programming Write a program that calculates the amount of money a person would earn...

    Python Computer Programming Write a program that calculates the amount of money a person would earn over a period of time if his or her salary is one penny the first day, two pennies the second day, and continues to double each day. The program should ask the user for the number of days. Display a table showing what the salary was for each day, then show the total pay at the end of the period. The output should be...

  • PAYTHON PROGRAM WITHOUT ANY FUNCTION AND METHOD A program that will allow a grocery store to...

    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...

  • How to write a program in python for "speed violation calculator" with a while loop and...

    How to write a program in python for "speed violation calculator" with a while loop and if statements. calculate the number of miles over the speed limit and display it. ask for the speed limit and the drivers speed the speed limit should be at least 20 but not greater than 70 if the driver's speed is less then the speed limit the driver was not speeding program should calculator and display the number of mph over the speed limit...

  • Write them in python IDLE ***** 5. Average Rainfall Write a program that uses nested loops...

    Write them in python IDLE ***** 5. Average Rainfall Write a program that uses nested loops to collect data and calculate the average rainfall over a period of years. The program should first ask for the number of years. The outer loop will iterate once for each year. The inner loop will iterate twelve times, once for each month. Each iteration of the inner loop will ask the user for the inches of rainfall for that month. After all iterations,...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT