Proj 3
Proj 3
Proj 3
NOTE: name and total_cost will be replaced by the input and calculated value
respectively
Write a statement at the bottom of the program to call the main() function.
THE PYTHON PROGRAM
The program should do what is specified in the PROBLEM section above. The program should
have the following features:
1) The first few lines of your program should be comments that state the program name, the
authors (your) name, date the program is released, and a brief description of the main task
performed by the program.
2) Your program should have meaningful variable names. There should be a comment before
each function definition and at each major function point: input, calculation, output.
EXTERNAL DOCUMENTATION
Type a report of your solution in a Word or OpenOffice Writer document. You should structure
your document in four clear sections each with a subheading as follows:
1. PROBLEM DEFINITION
The problem definition comes here. This is a summary of the PROBLEM section above.
2. ANALYSIS
Give the variables that you have identified to hold output data and explain the type of data
for each variable. Similarly, give variables to hold input data and describe them. If any
calculations will be performed, give variables to store results of formulas. Also give
variables to hold constants.
Give formulas to convert input data to output data using variable names that you identified.
3. DESIGN
Give the algorithm in pseudocode form of the step by step statements to carry out the
required programming task in English phrases. Explain the reasoning of the structure and
logic of your program. You may use diagrams such as structure charts and flowcharts in
addition to the pseudocode to present hierarchy and logic of your program. Pseudocode
should not be in Python. Present separate pseudocode for each function. In pseudocode,
statements inside functions should be indented and statements inside loops or if else
should be further indented.
4. IMPLEMENTATION
What was the platform and programming environment used? Name the Operating System
and compiler. How did you test your program? Give the data used to test the program. Did
you encounter any unusual situations when running the program (For example, what
happens when an alphabetic character is input instead of an account number)?
*** You should not put your Python program in the external documentation ***
APPENDIX
There are three tasks as follows:
1) Read the PROBLEM DEFINITION and think what you will need and how you will
arrange statements.
a) Variables appear in formulas or hold data read from keyboard or calculated.
b) Imagine your program was running at on a computer. What would it do first, then second,
then third? Notice that order matters. For example, comparison based on input means
input comes first then comparison is done.
c) Your thought process is written in the ANALYSIS (variables and formulas) and
DESIGN (structure of functions and pseudocode) parts of the external documentation.
The order of tasks is presented using pseudocode.
2) Take the ideas you came up with in (1) above and put them into Python code. You can write
the Python code on paper first. Use your textbook to find examples of how to translate
pseudocode into Python. Next do the following assuming you are using IDLE.
a)
b)
c)
d)
Run IDLE
Click on File on the menu and select New file. This will open an editor.
Type your Python program in the editor.
Click File on the menu and then click Save as. Give your program a name (for
example automobileCostCalculator) and click Save. In this example it will be saved as
automobileCostCalculator.py