Due: October 15, 2025
Points: 100
In the given examples, what you type is in redand the program prints what is in black. Your program output should look exactly like the output in the examples, except that what you type won’t be in red, and the results may differ in the last few digits.
To turn in: Please turn in the program in the file flattax.py.
Examples:
What is the income? 124598
The tax on income of 124598 is 21181.66
What is the income? -250
This doesn’t work for negative incomes like -250
What is the income? 124,598
Error – invalid input entered; put in an integer
What is the income? 698321
The tax on income of 698321 is 118714.57
Reject any negative incomes or input that is not a number.
To turn in: Please turn in the program in the file progtax.py.
Examples:
What is the income? 124598
The tax on income of 124598 is 34846.020000000004
What is the income? -250
This doesn’t work for negative incomes like -250
What is the income? 124,598
Error – invalid input entered; put in an integer
What is the income? 698321
The tax on income of 698321 is 224227.52000000002
Prompt the user for the radius and height, one per line. Both must be real numbers; they need not be integers.
To turn in: Please turn in the program in the file testtube.py.
Examples:
Radius of base of cone: 1 Height of cone: 5 The volume of a cone with radius 1.0 and height 5.0 is 15.707963267948966
Radius of base of cone: 2.3 Height of cone: 3.4 The volume of a cone with radius 2.3 and height 3.4 is 18.834895155822
Radius of base of cone: 1/5
Error – radius must be a real number
Radius of base of cone: 1 Height of cone: 3*4 Error – height must be a real number
To turn in: Please turn in the program in the file si.py.
Examples:
Number of days: 30
After 30 days, the proportion of the population infected is 0.287664368675717
Number of days: 40
After 40 days, the proportion of the population infected is 0.7489923252324207
Number of days: 10.3
You must enter an integer number of days
|
MHI 289I, Programming in Health Informatics Version of October 1, 2025 at 2:22PM
|
You can also obtain a PDF version of this. |