Use the command line to create a new directory called lab3 in your labs directory. Make sure all of the .py files that you create for this activity are in that directory.
Distance
In Emacs, create a Python program in a file called distance.py. The program should print the distance between the points and . The distance between two points can be calculated using the following formula:
Where is the distance between the points and . The program should use meaningful names for values and simple statements to make the program more readable. The output should be nicely formatted and labeled.
Oil Drum Volume
In Emacs, create a Python program in a file called oil_drum.py. The program should print the number of gallons in an oil drum. An oil drum is inches tall with a radius of inches. The volume of a cylinder can be computed using the equation:
Where is the volume of a cylinder, is the area of the base of the cylinder, is the height of thy cylinder, and is the radius of the cylinder. One gallon is cubic inches. The program should use meaningful names for values and simple statements to make the program more readable. The output should be nicely formatted and labeled.
Boring Origami
A single sheet of paper is inches thick. If you fold the paper in half, the two halves of the sheet of paper are together inches thick. If you fold the paper in half again the four quarters are together inches thick. How thick would the paper be if you folded it in half 10 times?
In Emacs, create a Python program in a file called origami.py. The program should print how thick a piece of paper would be if you folded it in half 10 times. The program should use meaningful names for values and simple statements to make the program more readable. The output should be nicely formatted and labeled.
Submission
Please show your source code and run your programs for the instructor or lab assistant. Only a programs that have perfect style and flawless functionality will be accepted as complete.