Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 3 Lnai 9286

Authors: Albert Bifet ,Michael May ,Bianca Zadrozny ,Ricard Gavalda ,Dino Pedreschi ,Francesco Bonchi ,Jaime Cardoso ,Myra Spiliopoulou

1st Edition

3319234609, 978-3319234601

More Books

Students also viewed these Databases questions

Question

1. What are the peculiarities of viruses ?

Answered: 1 week ago

Question

18. If you have power, then people will dislike and fear you.

Answered: 1 week ago