10
for
a subtotal and 15%
for gratuity rate, the program displays
$1.5
as gratuity and $11.5
as total.
ch02_pr05.py
.python3 ch02_pr05.py
on MAC and
py -3 ch02_pr05.py
on Windows)
user provides input:
Enter the subtotal and a gratuity rate: 10, 15
The gratuity is $1.50 and total is $11.50
python3 ch02_pr05.py
on MAC and
py -3 ch02_pr05.py
on Windows)
user provides input:
Enter the subtotal and a gratuity rate: 15.69, 15
The gratuity is $2.35 and total is $18.04
ch02_pr07.py
.python3 ch02_pr07.py
on MAC and
py -3 ch02_pr07.py
on Windows)
user provides input:
Enter the number of minutes: 1000000000
1000000000 minutes is approximately 1902 years and 214 days
twc = 35.74 + 0.6215ta - 35.75v0.16
+ 0.4275tav0.16
ta
is the outside temperature in degrees
Fahrenheit and v
is the speed measured in miles per hour.
twc
is the wind-chill temperature. The formula
cannot be used for wind speeds below 2 mph or temperatures below -58°F
or above 41°F.
ch02_pr09.py
.python3 ch02_pr09.py
on MAC and
py -3 ch02_pr09.py
on Windows)
user provides input:
Enter the temperature in Fahrenheit between -58 and 41:
5.3
Enter the wind speed (>=2) in miles per hour:
6
The wind chill index is -5.5671
find_color.py
.turn_degrees
and drive_cm
to move
the robot.cat find_color.py | ssh pi@gopigoXX python3 -u
on MAC and
type find_color.py | ssh pi@gopigoXX python3 -u
on Windows,
remember to use the correct hostname)
user provides input (output may vary):
The color in RGBA is ( 240, 220, 235, 180 ).
Finished returning to original position.
find_color.txt
. In this file, please
answer the following questions:
Area = (n*s2)/(4*tan(π/n))
s
is the length of a side. Write a program that prompts
the user to enter the number of sides and their length of a regular polygon
and displays its area. Please format the output to be in scientific notation
with six significant digits after the decimal place.
ch03_pr05.py
.python3 ch03_pr05.py
on MAC and
py -3 ch03_pr05.py
on Windows)
user provides input:
Enter the number of sides: 5
Enter the side length: 6.5
The area of the polygon is 7.269017e+01