Sale!

# ECE-203 Homework Week 2 solution

\$30.00

ECE-203
Homework Week 2

(20 Points) The formula for converting from degrees Fahrenheit to degrees Celsius is
C =
5
9
(F − 32)
Write a program that prints out a conversion table with degrees Fahrenheit in the first column and
degrees Celsius in the second column. The table should start at 0◦F and end at 100◦F with 10◦
increments. When displayed, decimals should be carried out to two places. Please note that table
formatting (i.e. whitespaces, etc) do not need to be perfect.
Name your program ftoc1.py and save its output as ftoc1.txt. Be sure to submit both files..
• If you need help capturing your program’s output in a text file, please watch the video
HOWTO: Saving Output, which is available under the Tutorials section of the course
website.

Category:

## Description

5/5 - (3 votes)

ECE-203
Homework Week 2

(20 Points) The formula for converting from degrees Fahrenheit to degrees Celsius is
C =
5
9
(F − 32)
Write a program that prints out a conversion table with degrees Fahrenheit in the first column and
degrees Celsius in the second column. The table should start at 0◦F and end at 100◦F with 10◦
increments. When displayed, decimals should be carried out to two places. Please note that table
formatting (i.e. whitespaces, etc) do not need to be perfect.
Name your program ftoc1.py and save its output as ftoc1.txt. Be sure to submit both files..
• If you need help capturing your program’s output in a text file, please watch the video
HOWTO: Saving Output, which is available under the Tutorials section of the course
website.
• If you need help transferring your program file (ftoc1.py) and its output (ftoc1.txt) to your
local computer for upload to BBLearn, please watch HOWTO: Transferring Files via
SFTP, which is also available under the Tutorials section of the course website.
(10 Points) The conversion from Fahrenheit to Celsius is often approximated as
C ≈ Cˆ =
1
2
(F − 30)
when people perform the conversion mentally or conversationally. Create a new program based
on ftoc1.py that adds a third column containing this approximation as well as a fourth column
containing the error of the approximation (as Cˆ − C). When displayed, decimals should be carried
out to two places.
Name your program ftoc2.py and save its output as ftoc2.txt. Be sure to submit both files.
(20 Points) Write a Python program to compute the following expression:
s =

M
k=1
1
k
Write your program so that the limit of summation M is defined at run time by taking user input
from the keyboard. When writing your program, you may assume that the user will type in only
valid input.
Name your program summation.py and save its output as summation.txt. Be sure to submit
both files.
1