Extra Credit 1

Due: October 6, 2021
Points: 20


In the given examples, what you type is in red and 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.

Add exception handling to the answer for problem 1, so that if the input is not a number, the program prints an error message.

In the second example below, notice there are two decimal points (which is not allowed).

To turn in: Please turn in the program in the file weightcvt-ex.py.

Examples:


Enter temperature in degrees Fahrenheit: hello
The input must be a real number


Enter temperature in degrees Fahrenheit: 100..5
The input must be a real number


UC Davis sigil
Matt Bishop
Office: 2209 Watershed Sciences
Phone: +1 (530) 752-8060
Email: mabishop@ucdavis.edu
ECS 235A, Computer and Information Security
Version of September 23, 2022 at 2:23PM

You can also obtain a PDF version of this.

Valid HTML 4.01 Transitional Built with BBEdit Built on a Macintosh