Project 01
Project 01
Programming Project #1
Assignment Overview
This assignment involves coding and testing of a program that uses Python arithmetic.
The basic design of your first program that in this class prompts for input, performs arithmetic on
that information and then displays the results.
This assignment is worth 15 points (1.5% of course grade), and must be completed before 11:59 PM
on Monday, January 16th. (Projects are typically due on Mondays.)
Background
This programming project will use the input and print functions along with some simple
mathematics for conversion. The important part of the project is to learn the skills needed to access
the class web site to download a project description, create a new program in Python and finally to
hand it in.
Program Specifications
Conversions are useful both in science and daily life. Here we examine some obscure, but useful
conversions as well as some silly ones.
Here is a piece of a BWCA map showing portages between lakes (black lines) labeled in rods (red
triangles are campsites).
Your program will prompt the user for a floating-point value representing a distance in rods. You
will reprint that value along with that value converted to the following values. The most important
value is the time to walk the portage.
meters
feet
miles
furlongs
the time in minutes to walk that distance
You can find these measures on the web, but so everyone is using the same conversions:
1 rod = 5.0292 meters
1 furlong = 40 rods
1 mile = 1609.34 meters
1 foot = 0.3048 meters
average walking speed is 3.1 miles per hour
Deliverables
The deliverable for this assignment is the following file:
Be sure to use the specified file name and to submit it for grading via the handin system before
the project deadline
Assignment Notes:
1. To clarify the project specifications, sample output is appended to the end of this document.
2. Items 1-6 of the Coding Standard will be enforced for this project.
3. The input function is used to accept a response from the user. The function accepts a
string (a sequence of characters between quotes) as a prompt to display to the user. It then
waits until the user types a response (terminated by the user touching the Enter key).
Finally, the function returns the user’s response as a string.
If the user’s response is supposed to be processed as a numeric value, the returned string
must be converted into a number. When working with floating point values, a string is
converted into a floating point number using the float function. The function accepts a
string as its argument and returns the floating point number which the string represents. A
typical interaction would be something like:
4. The print function is used to display any combination of variables, values and strings in
the output window. Each item to be displayed must be separated from another item by a
comma. All the items will be displayed together, followed by a new line. For example:
Assuming that the value of the variable num_int is 26, then the output will be:
26 times two is 52
5. The file named number_input.py in the project directory contains a program which
illustrates the use of some standard library functions.
Getting Started
Solve the problem using pencil and paper first. You cannot write a program until you have
figured out how to solve the problem. This first step can be done collaboratively with
another student. However, once the discussion turns to Python specifics and the subsequent
writing of Python, you must work on your own.
Use Anaconda Spyder to create a new program. Use the required file name (proj01.py).
Write a simple version of the program, e.g. input the rods and print rods. Run the program
and track down any errors.
Use the handin system to turn in the first version of your program.
Sample Interaction
First are two samples with 1 rod and 10 rods so the numbers are easy to check with pencil and
paper.
Next is a test using a distance from the map: 444 rods
Scoring Rubric
If you correctly run the three sample tests, you will automatically get 10 of the 15 points. Here is
the scoring rubric for this assignment.
Program Implementation
TA Comments