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
Which activity represents a violation of the licensing agreement?
Lena [83]
A) <span>unauthorized duplication of software </span>
6 0
3 years ago
Read 2 more answers
When viewing data entered into a spreadsheet, the columns identify _____.?
AlexFokin [52]
The answer is : variables
When viewing data entered into a spreadsheet, the columns identify Variable. The variables later can be used on a formula to help you process any sort of data that is implemented within excels' formula system
3 0
4 years ago
Type the correct answer in the box. Spell all words correctly. What type of network is the Internet? The Internet is an example
denis23 [38]

Answer:

The answer is WAN (Wide Area Network).

Explanation:

  • The Internet is an example of WAN. It stands for wide area network. It is an information network that commonly links to computers that cover a broad specific area. In a WAN, two towns, states, or countries are linked.  
  • The main purpose of using WAN includes a wide range, offers unified information, get upgraded files and software, several email sharing applications, etc.
6 0
3 years ago
Which of the following describes a decision support system (DSS)?
levacccp [35]

Answer:

B.

Explanation:

8 0
3 years ago
Read 2 more answers
NEED HELP ON TEST!!!
Phoenix [80]

Answer:

1.  \: speaker \:  notes \\ 2. \: accessible

5 0
3 years ago
Other questions:
  • Write a program that accepts any number of homework scores ranging in value from 0 through
    10·1 answer
  • What does software alone enable a computer to do? connect to the Internet control processing speeds interact with the user manag
    11·2 answers
  • Assume the following JavaScript program was interpreted using staticscoping rules. What value of x is displayed in function sub1
    12·1 answer
  • Write a program that takes a date as input and outputs the date's season. The input is a string to represent the month and an in
    13·2 answers
  • What can be done to improve the security of business uses of the Internet? Give several examples of ecurity measures and technol
    9·1 answer
  • A company gives you a document to review. This document lays out the strengths and weaknesses of a proposed business venture. It
    13·1 answer
  • There is an interface I that has abstract class AC as its subclass. Class C inherits AC. We know that C delegates to an object o
    12·1 answer
  • PLEASE HELP AND FAST!!!!!<br>Which of the following devices uses binary code?
    6·2 answers
  • What is the computer that is connected to a<br> server
    8·2 answers
  • 2. what are the advantages of breaking up a single logical message into a number of fixed-sized packets and then sending each on
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!