Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assume that the infection rate of a newly discovered virus is as follows: In the first month 50% of the population is infected. In the
Assume that the infection rate of a newly discovered virus is as follows:
In the first month 50% of the population is infected.
In the second month 40% of the uninfected population is infected.
In the third month 30% of the uninfected population is infected.
In the forth month 20% of the uninfected population is infected.
In the fifth month 10% of the uninfected population is infected.
Write a program that will accept form the user the total population (number of people) and print to the screen the number of people who are infected each month, the total number of people infected at the end of 5 months and the total number of people uninfected at the end of 5 months. Display all numbers as whole numbers.
How to get input from the user has been demonstrated in prior parts of this assignemnt set.
Problem Set 2: Part 5 (2 Points). Name the file PS2_Part5.py
In this assignment you are to write a program that will calculate and print to the screen the number of gallons of paint needed to paint a room.
A gallon of paint will cover 400 square feet
A door has an area of 20 square feet
A window has an area of 15 square feet
Your program must ask the user to enter the following information, and save the values entered into variables (use the names below):
roomLength
roomWidth
roomHeight
numberOfDoors
numberOfWindows
Example #1:
Please enter the length of the room:
12.5
Please enter the width of the room:
10.0
Please enter the height of the room:
7.5
Please enter the number of windows:
3
Please enter the number of doors:
2
Square Feet: 252.5
Gallons Needed: .63125
Example #2:
Please enter the length of the room:
20.0
Please enter the width of the room:
30.0
Please enter the height of the room:
8
Please enter the number of windows:
4
Please enter the number of doors:
2
Square Feet: 700
Gallons Needed: 1.75
How to get input from the user has been demonstrated in prior parts of this assignemnt set.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started