The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 2 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
I need help with this assignment, please. It's due by tomorrow.
Â
Â
COSC 1336 Lab: 3
Relevant Reading: Chapter 4
Due February 20, 2017
(Late date: February 22, 2017)
12.5 points
Problem 1. [2.5 points] Write the code that prompts the user to enter a number in the range
of 1 through 10 using repetition and validates the input. If an invalid value is entered it
should provide an error message and continue to prompt the user for a valid entry until one
is given. (rangeA.py)
Problem 2. [10 points] A bug collector collects bugs every day for seven days. Write a
program (bug_count.py) that keeps a running total of the number of bugs collected for each
day using a count-controlled loop and another (bugs_cond.py) that uses a condition based
loop. The loop should ask for the number of bugs collected each day, and when the loop is
finished, the program should display the total number of bugs collected.
Do not use the range function in either of your implementations. When you have completed all of the problems, make sure that you have attached all the
files and then click Submit. Remember that you can save each file as you complete it, but
you must wait until all files have been attached before submitting, as you can only submit
once. For this lab you should submit the following files: bugs_count_LastName.py
bugs_cond_LastName.py
rangeA_LastName.py
rangeB_LastName.py **Be sure to add your last name to the file name and follow formatting guidelines to avoid
point deductions.
Be sure to apply your defensive programming skills to insure that only valid inputs are received
from the user. 1