Assignment id:
project2
Required Files:
project2.py rubric-temperatureConverter.txt
Due Date
See the
calendar for due date.
Objectives:
- Practice using input and output functions
- Practice formatting output
- Practice using conditional logic
Description:
Write a python script (with comments) that prompts the user for a temperature (in Celsius) and displays the corresponding temperature in Fahrenheit.
The formula to convert from Celsius to Fahrenheit is:
Fahrenheit = 9 / 5 * Celsius + 32
Display one digit of precise for the temperature.
Additionally, if the temperature is 100 degrees Fahrenheit or more, display the message, "It's hot outside!", and if it's less than or equal to 32 degrees Fahrenheit, "Do you want to build a snowman?".
Finally, copy the rubric portion below to a
.txt file (not a Word document nor a Rich Text Format file) name
rubric-temperatureConverter.txt.
Assign points to each item in the grading rubric to verify that you've completed all the necessary requirements.
Examples
For example, the following are examples of correct execution (with the text in bold being the input from the user):
Please enter a temperature in Celsius: -21.3
That's -6.3 degrees Fahrenheit
Do you want to build a snowman?
Please enter a temperature in Celsius: 0
That's 32.0 degrees Fahrenheit
Do you want to build a snowman?
Please enter a temperature in Celsius: 32.1
That's 89.8 degrees Fahrenheit
Please enter a temperature in Celsius: 100
That's 212.0 degrees Fahrenheit
It's hot outside!
Submission
Submit your python script using the
handin program. For
handin, for this lab, type the following in a terminal window exactly as it appears:
handin project2 project2.py rubric-temperatureConverter.txt
To verify your submission, type the following in a terminal window:
handin project2
Rubric:
Points Item
---------- --------------------------------------------------------------
_____ / 10 Meaniful comments
_____ / 10 User prompted for input
_____ / 10 Correctly calculates the temperature in Fahrenheit
_____ / 10 Output display one digit of precision
_____ / 10 Displays message when it's at or below freezing or at least 100 degrees
_____ / 2 Completed rubric (estimates for each line including hours spent)
_____ / 52 Total
_____ Approximate number of hours spent
Notes
- Before writing any code, design a flowchart of how your algorithm will work. Then, write the comments. Then, get just the prompt working. Verify that it works. Then, work on the next step.
- You can assume that a number will be entered by the user.