Question
Python: 1. Write a program to prompt for a score between 0.0 and 1.0. If the score is out of range print an error. If
Python:
1. Write a program to prompt for a score between 0.0 and 1.0. If the score is out of range print an error. If the score is between 0.0 and 1.0, print a grade using the following table:
Score Grade >= 0.9 A >= 0.8 B >= 0.7 C >= 0.6 D < 0.6 F
Example input and output: Enter score: 0.95 A Enter score: perfect Invalid input Enter score: 10.0 Invalid input Enter score: 0.75 C Enter score: 0.5 F
Run you program multiple times to check different input values and if your program can handle exceptions
2. Make a program where you set a length given in meters and then compute and write out the corresponding length measured in inches, in feet, in yards, and in miles. Use that one inch is 2.54 cm, one foot is 12 inches, one yard is 3 feet, and one British mile is 1760 yards. For verification, a length of 640 meters corresponds to 25196.85 inches, 2099.74 feet, 699.91 yards, or 0.3977 miles.
3. Let p be a banks interest rate in percent per year. An initial amount A has then grown to (1+ /100) after n years. Make a program for computing how much money 1000 dollars have grown to after three years with 5 percent interest rate.
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