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 of the following operations are considered to be crucial tasks that should be performed before installing server roles and
Bas_tet [7]

Answer:

A. Static IP address have been configured.

Explanation:

A network is an interconnection of network devices for communication to occur. A network comprises of end devices and intermediate network devices.

End devices are the sources and destinations of data transmission, while intermediate devices are the devices that makes communication of data possible like routers and switches. Examples of end devices are servers and workstations (computers, smartphones etc.).

A server in a network is a device that provides special services to workstations or clients. The IP addresses of servers must be known, that is, a static IP address must be configured on a server. Examples of server protocols are DNS, TFTP, FTP, DHCP etc.

8 0
3 years ago
Create an application named Percentages whose main() method holds two double variables. Assign values to the variables. Pass bot
lbvjy [14]

Answer:

The codes below implement the problem statements

Explanation:

public class Percentages {

public static void computePercent (int a,int b)

{

System.out.println(a+" is "+(a*100/b)+"% of "+b);    

}

 

public static void main(String []args)

{

int a=2;

int b=5;

computePercent(a,b);

computePercent(b,a);

}

}

<u> </u>

<u>Part(b) </u>

import java.util.*;

public class Percentages {

public static void computePercent (int a,int b)

{

System.out.println(a+" is "+(a*100/b)+"% of "+b);

}

 

public static void main(String []args)

{

Scanner s= new Scanner(System.in);

int a=s.nextInt();

int b=s.nextInt();

computePercent(a,b);

computePercent(b,a);

}

}

8 0
3 years ago
Are all the computer users known as programmer ​
Evgesh-ka [11]

Answer:

Nope

Explanation:

programmers are diff

6 0
2 years ago
1. Which markup language adds the ability to use video without requiring the user to download add-ons?
aniked [119]

HTML5

HTML5 has fewer plug-ins like the ability to standardize how audio and video are presented on a Web page. It introduces the <video> element designed to remove the need to install 3rd party add-ons and plug-ins like adobe flash player. It also adds the <audio> element  too that allows pages to smoothly add audio files.

3 0
3 years ago
A previously saved labels report can be accessed from the
Tcecarenko [31]

C. is the answer to that question

6 0
3 years ago
Other questions:
  • Which of the following criteria would not make a person eligible to receive medicare benefits?Which of the following criteria wo
    12·2 answers
  • Click to review the online content. Then answer the question(s) below, using complete sentences. Scroll down to view additional
    8·1 answer
  • When a computer is booted the checks the computer's components?
    7·1 answer
  • Works in the public domain have copyright that are expired or abandoned true or false
    5·1 answer
  • A user reports that he cleared a paper jam and now cannot print. The technician reseats the paper and then prints a test page fr
    14·1 answer
  • What is the code name for the 12 engineers who developed the ibm pc?
    8·1 answer
  • Since the web.xml file describes how the web application should be configured when it is deployed on a server, the file is known
    7·1 answer
  • Tgif
    7·1 answer
  • What makes a source credible?
    9·2 answers
  • Write a program that asks the user to enter a positive integer that represents a number in the decimal system and then displays
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!