1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
sergiy2304 [10]
3 years ago
12

A bug collector collects bugs every day for 5 days. Write a program that keeps a running total of the number of bugs collected d

uring the five days. The loop should ask for the number of bugs collected for each day, and when the loop is finished, the program should display the total number of bugs collected.

Computers and Technology
1 answer:
Brums [2.3K]3 years ago
7 0

Answer:

Complete code with step by step comments for explanation and output results are given below.

Python Code with Explanation:

# Initialize the counter total_bugs to store the running total of bugs  

total_bugs = 0

# Define number of days

days = 5

# Use a for loop to run for "days" number of times to take input from user

for i in range(days):

# i+1 makes sure the days start from 1 rather than 0

   print('Please enter the no. of bugs collected on day',i+1)

# Ask the user to input no. of bugs collected each day

   bugs = eval(input("Bugs collected: "))

# Keep adding new number of bugs  into running total of number of bugs

   total_bugs += bugs

# Print the total number of bugs collected in 5 days

print('The total number of bugs collected in 5 days: ', total_bugs)

Output:

Please enter the no. of bugs collected on day 1

Bugs collected: 10

Please enter the no. of bugs collected on day 1

Bugs collected: 20

Please enter the no. of bugs collected on day 1

Bugs collected: 15

Please enter the no. of bugs collected on day 1

Bugs collected: 10

Please enter the no. of bugs collected on day 1

Bugs collected: 30

The total number of bugs collected in 5 days: 85

You might be interested in
The process of arranging the item of a column in some sequence or order is known as?
MatroZZZ [7]

answer: sorting??  

(hope it helps)

6 0
2 years ago
Assuming your computer only has one network card installed; explain how your virtual machine is able to share that card with you
adell [148]

Answer and Explanation:

Virtual machine have one imitated organize connector and there is one of a kind MAC address is allocated with it.  

The system driver of the Virtual machine's performs all the task:  

  • The system driver places physical connector in 'promiscuous' mode implies physical connector will acknowledge all system parcel paying little heed to MAC address,then virtual machine's driver channels its bundles and direct it to the virtual machine.
5 0
2 years ago
Which is the most common way to install memory in a laptop?
alina1380 [7]

install memory requires you to take off the bottom portion of the laptop.

7 0
3 years ago
Why can't I access my micro SD card on my Lenovo ThinkPad Yoga 11e? I'm trying to export some PNG files onto my Micro SD card, s
BabaBlast [244]

maybe you need a new sd card

6 0
3 years ago
Matt goes to an Internet café and tries to access his emails. The email client asks Matt to enter his email address along with t
Radda [10]

Answer:

acknowledging

Explanation:

it has to be d

6 0
3 years ago
Other questions:
  • Name size of machine screw that is used to secure switches and receptacles to device boxes
    13·1 answer
  • Elizabeth works for a local restaurant at the end of her shift she read she’s required to write in the time that she arrived in
    9·1 answer
  • The very first thing I should type when creating a formula in excel is:
    15·2 answers
  • What is the post condition of an expression or variable
    11·1 answer
  • Questiul 2
    10·1 answer
  • The
    6·2 answers
  • True or false when a host gets an IP address from a DHCP server it is said to be configured manually
    15·1 answer
  • Hi, I just have a few questions from my digital tech assignment.
    14·2 answers
  • Which two components are configured via software in order for a PC to participate in a network environment
    5·1 answer
  • Why would over-50 executives have a harder time buying into the idea of social media?​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!