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
What is the first computer ever made?????
Leviafan [203]
The manchester mark 1
6 0
3 years ago
Read 2 more answers
Which of the following is an HTTP response status type?
andrey2020 [161]

Answer: All of the above

Explanation:

200 OK, 301 permanently moved and 400 bad request all are the Hyper text transfer protocol (HTTP) response status type. The HTTP response status types basically indicated the complete request in the HTTP.

All these given types are the responses and request that are involved in the HTTP status type.

200 OK is one of the request which basically depends upon the HTTP status type success.

301 permanently moved is the response in the URL which are used for permanently change the resources of request.

And 400 bad request is not properly understand by server due to the invalid syntax in the HTTP.

6 0
4 years ago
Which two computer peripherals are connected to the computer through a port?
chubhunter [2.5K]
Most computer devices are connected to the computer through port
Keyboard through usb port
Printer through usb port
Hand point device through usb port
Also computer equipped with LPT port for printers and COM port for additional devices like external modems e.t.c
7 0
4 years ago
Write a function that asks a user for his/her name and movie
Alex777 [14]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

                     

The code is written in C++

/******************************************************************************

                             Online C++ Compiler.

              Code, Compile, Run and Debug C++ program online.

Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>

#include <string>  

using namespace std;

void display()

   {

       string yourName;

       string watchedMovie;

       cout<<"What is your name?  ";

       cin>>yourName;

       cout<<"Which movie have you seen?  ";

       cin>>watchedMovie;

       cout<<"Today, I have learned that  " <<name<<" watched "<<watchedMovie<<" movie";

   }

int main()

{    

   

   display();

   return 0;

}

 

7 0
3 years ago
Which method of deleting files can be used in windows xp and vista?
Makovka662 [10]
The correct answer is C.

4 0
3 years ago
Other questions:
  • Parameter variables should not be changed within the body of a method because _______________. Select one: a. it mixes the conce
    5·1 answer
  • A video streaming website uses 32 bit integers to count the number of times each video is played. In anticipation of some videos
    14·2 answers
  • Integration Management, one of the 10 PMBOK Guide Knowledge Areas, represents the processes and activities to identify, define,
    12·1 answer
  • Working together, printer A and printer B would finish the task in 24 minutes. Printer A alone would finish the task in 60 minut
    8·1 answer
  • What are the four common tags used on webpages?
    11·1 answer
  • Write a void method named myMethod which prints "This is a void method" (without the quotes). Your method should be declared pub
    5·1 answer
  • Cómo fue posible que los alemanes exterminando seres humanos​
    11·1 answer
  • Discuss TWO changes in ICMP that took place with the development of IPV6 and indicate why those changes were made.
    7·1 answer
  • Explain the basic operations of a computer system​
    6·1 answer
  • 5 points)*list all of the data that needs to be kept track of for the scenario above in a 1nf (flat file) table (20 points)*use
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!