- p. 22, problem 7 (save as
p1_7.py).
Degrees F:86
86.0 degrees F = 30.0 degrees C
- p. 22, problem 8 (save as
p1_8.py).
radius:10
diameter: 20.0
circumference: 62.8318530718
area: 314.159265359
- p. 22, problem 9 (save as
p1_9.py).
angle:1.18
sine: 0.924606012408
cosine: 0.380924824367
- p. 40, problem 1 (save as
p2_1.py).
1st value:1
2nd value:2
3rd value:3
3.0
- p. 40, problem 2 (save as
p2_2.py).
1st string:c
2nd string:b
3rd string:a
a b c
- p. 41, problem 3 (save as
p2_3.py).
Example 1:
a:3
b:4
c:5
Pythagorean triple
Example 2:
a:1
b:2
c:3
Not pythagorean
- p. 41, problem 8 (save as
p2_8.py).
Note: The discriminant is b2 - 4ac.
Example 1:
a:1
b:2
c:1
One double root
Example 2:
a:1
b:2
c:3
Two complex roots
Example 3:
a:2
b:4
c:1
Two real roots
- p. 41, problem 10 (save as
p2_10.py).
Example 1:
Enter hourly wage: 9.50
Enter hours worked: 30
Wages earned: 285.0
Example 2:
Enter hourly wage: 9.50
Enter hours worked: 50
Wages earned: 522.5
- p. 42, problem 17 (save as
p2_17.py).
Example 1:
Enter year: 1804
leap year
Example 2:
Enter year: 1900
not leap year
Example 3:
Enter year: 2000
leap year
Example 4:
Enter year: 1979
not leap year