Question

In: Computer Science

Do Programming Exercise 1 (Bug collector) - Page 203 (Page 180 is good inspiration: Output should...

Do Programming Exercise 1 (Bug collector) - Page 203 (Page 180 is good inspiration: Output should look like this... Enter the number of bugs collected today on day 1 : 10 Enter the number of bugs collected today on day 2 : 5 Enter the number of bugs collected today on day 3 : 20 Enter the number of bugs collected today on day 4 : 0 Enter the number of bugs collected today on day 5 : 40 Total bugs collected: 75

Solutions

Expert Solution

bugs=0

#looping from 1 to 5 days

#collecting bugs and adding to sum

for i in range(1,6):

bugs+=int(input("Enter the number of bugs collected today on day "+str(i)+" : "))

#printing total bugs

print("Total bugs collected: ",bugs)

Note : If you like my answer please rate and help me it is very Imp for me


Related Solutions

Do Programming Exercise 1 (Day of the Week) – Page 151 Output should look like this.....
Do Programming Exercise 1 (Day of the Week) – Page 151 Output should look like this.. >>> =RESTART: C:/Users/gamada/AppData/Local/Programs/python/python36/week/py= what is your name? gamada Enter a number (1-7) for the day of the week: 3 you selected 3 which is wednesday
This is an exercise to design and write a Python program in good programming style for...
This is an exercise to design and write a Python program in good programming style for a simulation of stock price over a period of 100 days. In this exercise, you are asked to simulate the stock price starting at $100.00 for 100 days with a daily fluctuation based on the Normal Distribution with mean = 0.0 & sigma = 0.0125. The program will show the daily stock price, the 7-day minimum, the 7-day maximum, the 7-day average, and the...
7.5 Apartment rents. Refer to Exercise 7.1 (page 360). Do these data give good reason to...
7.5 Apartment rents. Refer to Exercise 7.1 (page 360). Do these data give good reason to believe that the average rent for all advertised one-bedroom apartments is greater than $650 per month? Make sure to state the hypotheses, find the t statistic, degrees of freedom, and P-value, and state your conclusion using the 5% significance level. Reference: 7.1 One-bedroom rental apartment. A large city newspaper contains several hundred advertisements for one-bedroom apartments. You choose 25 at random and calculate a...
THIS QUESTION IS BASED UPON JAVA PROGRAMMING. Exercise 1 In this exercise, you will add a...
THIS QUESTION IS BASED UPON JAVA PROGRAMMING. Exercise 1 In this exercise, you will add a method swapNodes to SinglyLinkedList class. This method should swap two nodes node1 and node2 (and not just their contents) given references only to node1 and node2. The new method should check if node1 and node2 are the same nodes, etc. Write the main method to test the swapNodes method. Hint: You may need to traverse the list. Exercise 2 In this exercise, you will...
C Programming Number output lines of a text file as it prints to the terminal Do...
C Programming Number output lines of a text file as it prints to the terminal Do not use fgets or fopen It is possible to open file without fopen using SyS commands such as open and RDONLY Example 1 Line 1 2 Line2
C++ Programming: Programming Design and Data Structures Chapter 13 Ex 2 Redo Programming Exercise 1 by...
C++ Programming: Programming Design and Data Structures Chapter 13 Ex 2 Redo Programming Exercise 1 by overloading the operators as nonmembers of the class rectangleType. The header and implementation file from Exercise 1 have been provided. Write a test program that tests various operations on the class rectangleType. I need a main.cpp file Given: **************rectangleType.cpp******************** #include <iostream> #include <cassert> #include "rectangleType.h" using namespace std; void rectangleType::setDimension(double l, double w) { if (l >= 0) length = l; else length =...
Starting Out with Python 4th ed., Page 104 Programming exercise #14 When a bank account pays...
Starting Out with Python 4th ed., Page 104 Programming exercise #14 When a bank account pays compound interest, it pays interest not only on the principal amount that was deposited into the account, but also on the interest that has accumulated over time. Suppose you want to deposit some money into a savings account, and let the account earn compound interest for a certain number of years. The formula for calculating the balance of the account after a specified number...
Focus on: Basic list operations, methods, use of functions, and good programming style. Program should be...
Focus on: Basic list operations, methods, use of functions, and good programming style. Program should be in basic python. Part 1. Write a program that does the following: 1. Create a list of length N where N is a randomly selected integer between 10 and 20 and whose elements are randomly selected integers between 0 and 19. 2. Print out the list. 3. Create a copy of the list. Sort the copy into decreasing order and print it. 4. Report...
You should produce SPSS output that should include the information that is requested. Do not exceed...
You should produce SPSS output that should include the information that is requested. Do not exceed more than 2 pages of output. You need to determine the mean, median, mode, range, standard deviation and variance of the following data. Produce a graph that allows the mayor to determine if the data are normally distributed. USE SPSS PLEASE I UNDERSTAND HOW TO GET THE MEAN,MEDIAN,MODE, STAND DEV BUT I DONT KNOW HOW TO PUT IT INTO A GRAPH Legionnaires Cases/Month 5...
afe Rational Fractions In week 4 we completed Chapter 13 Programming Exercise #10 Page 974. Make...
afe Rational Fractions In week 4 we completed Chapter 13 Programming Exercise #10 Page 974. Make sure you have a working fractionType class before starting this assignment. The template requirement from week 4 is not required for this assignment. Your assignment this week is to make your fractionType class safe by using exception handling. Use exceptions so that your program handles the exceptions division by zero and invalid input. An example of invalid input would be entering a fraction such...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT