Due: October 12, 2023
Points: 100
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. Also, the symbol “↵” is a newline (return or enter keys).
After 5 terms, the approximation is 3.1426047456630846
After 5 terms, the approximation 3.1426047456630846 does not change
Your numbers may differ from the examples; this is intended to show you the format of the output only.
To turn in: Please turn in the program in the file sharp.py.
Your program must give an error message and exit if the user enters anything other than a positive integer.
Here is sample output. Each is from a separate run of the program.
Year> 2020↵ 2020 is a leap year
Year> 2000↵ 2000 is a leap year
Year> 1900↵ 1900 is not a leap year
Year> hello↵ You must enter the year as a positive integer
Year> -12↵ You must enter the year as a positive integer
| | | | | | -----+-----+----- | | | | | | -----+-----+----- | | | | | |
To turn in: Please turn in the program in the file ftoc-fixed.py.
Here are examples of the correctly working program:
Temperature in Fahrenheit: -40↵ -40.0 in Fahrenheit is -40.0 in Celsius
Temperature in Fahrenheit: 99.99↵ 99.99 in Fahrenheit is 37.77 in Celsius
Temperature in Fahrenheit: 212.56↵ 212.56 in Fahrenheit is 100.31 in Celsius
|
ECS 235A, Computer and Information Security Version of October 3, 2023 at 11:37PM
|
You can also obtain a PDF version of this. |