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]
4 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]4 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
Programmers compile a list of instructions to build their applications. These instructions are typically grouped into units of c
kotykmax [81]

Answer: Threads

Explanation: Threads are the part of the programs in the computer field. It is like the way in which the execution of the procedure/process is carried out. There are also chances of having multiple threads depending on the process.

It's like the command line as an individual which gets processed which can work in the core of the computer system.The condition in the system that there must be presence of atleast one thread .

4 0
3 years ago
question 1 scenario 1, question 1-5 you’ve just started a new job as a data analyst. you’re working for a midsized pharmacy chai
zvonat [6]

In the case above, the right thing that one need to do  is to  Download the data as a .CSV file, then import it into a spreadsheet.

<h3>What is in a CSV file?</h3>

A CSV is known to be a comma-separated values file and this is said to be a a text file that is known to contain all the information that is often separated by the use of commas.

Note that the CSV files are said to be one that are known to be commonly seen in spreadsheets as well as in databases.

A person can be able to make use of a  CSV file to be able to transmit data between programs that are known to be not ordinarily available to exchange data.

Therefore, In the case above, the right thing that one need to do  is to  Download the data as a .CSV file, then import it into a spreadsheet.

Learn more about CSV file from

brainly.com/question/14338529

#SPJ1

6 0
2 years ago
Assume that name and age have been declared suitably for storing names (like "Abdullah", "Alexandra" and "Zoe") and ages respect
Irina18 [472]

Answer:

import java.util.Scanner;

public class num2 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter Name");

       String name = in.next();

       System.out.println("Enter Age");

       int age = in.nextInt();

       System.out.println("The age of "+name +" is "+age);

   }

}

Explanation:

Java programming language is used to write the code.

The scanner class is used to prompt and receive values for name and age which are stored in the appropriate variables.

The key idea here is using string concatenation in the output statement in order to print the desired output

3 0
4 years ago
Unscramble the words <br><br> A: ESUOM RETUPOC <br><br> B: KSID EVIRD
Mrrafil [7]
A. Mouse coputer
B. Disk drive
5 0
4 years ago
Read 2 more answers
Which computers were the first PCs with a GUI<br> MS-DOS <br> Linux<br> Windows<br> Mac
sergeinik [125]

Answer:

The first computer with a GUI were linux, microsoft and apple.

Explanation:

I think this is right. Hope it helped <3

8 0
3 years ago
Read 2 more answers
Other questions:
  • Use the image above to determine which toolbars will be displayed in the program you are using. SELECT ALL THAT APPLY
    11·2 answers
  • What is one of the most effective security tools available for protecting users from external threats?
    15·1 answer
  • An aircraft departs an airport in the mountain standard time zone at 1615 MST for a 2-hour 15-minute flight to an airport locate
    14·1 answer
  • Consider the problem of making change for n cents using the fewest number of coins. Assume that each coins value is an integer.
    7·1 answer
  • What is the promotion and advertising stage of a product or service called?
    15·1 answer
  • Bcr is an out put device true or false​
    13·2 answers
  • What does an upright (straight) body posture convey or show? [ ]
    10·1 answer
  • We cannot imagine a life without the Internet. Imagine that you had to live without being connected to the Internet. Discuss the
    13·1 answer
  • How to mark a discussion as read on canvas dashboard.
    10·1 answer
  • You have a server that has a 100basefx network interface card that you need to connect to a switch. the switch only has 100baset
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!