Reference no: EM132356206
Programming Project
1. INTRODUCTION The goal of this programming assignment to enable the student to write a Python program that uses iteration and decision to solve a problem.
2. PROBLEM DEFINITION Write a Python program that is a Math tutor. When the program runs, it should do the following: In a loop that runs until quit is input by the user:
a) Display a menu offering a user to choose one of the following: addition, subtraction, multiplication, division, quit
b) Read the user option from the keyboard
c) If user option is valid and not quit i Display a message asking the user to enter two integers and ii Read the two numbers from the keyboard iii Display a message asking the user to enter the answer depending on the option iv Read the user's answer from the keyboard v If option was addition, Add the two numbers entered by the user Else if option was subtraction Subtract the second number from the first entered by the user Else if option was multiplication Multiply the two numbers entered by the user Else if option was division Divide the first number by the second entered by the user
d) Else if option was quit Display message thanking user for using the Math Tutor
e) If not quit and valid option result of computation equals user answer then Display message that answer is correct Else if not quit and valid option and result of computation not equal user answer Display message that answer is incorrect and display correct answer 3.
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 author's (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 (names should not be single letter or abbreviations for example a is not a good name but firstNumber is a good name). There should be a comment on each major function point such as: variable declarations, input, start of if or elif or else, loop, calculation, output.
4. EXTERNAL DOCUMENTATION Type a report of your solution and save in a Word or PDF 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. Do not copy the text that I have written. Rather, phrase the problem in two or three English sentences.
2. ANALYSIS Give the variables that you have identified to hold output data and say their purpose and the type of data (type of data means integer, string, floating point number, single character) for each variable. Similarly, give variables to hold input data and give their purpose and type of data. 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. Pseudocode should not be in essay form. Rather, it should be short phrases with indentation with a bias towards what the final program will look like. See page 165 in your book and the "Credit Limit" program in "PowerPoint slides and tutorials" on Blackboard for example of pseudocode of an algorithm involving a loop.
4. IMPLEMENTATION Write in essay form, a description of your implementation. Implementation details include the platform and programming environment used. (Note that platform means CPU/Operating System combo. Example of a platform is Dell Computer with Intel 8-Core 2.8GHz processor running Windows 10.) Give the name of the development environment that you used such as IDLE. How did you test your program? Give the data used to test the program. Did you encounter any unusual situations when running the program? Example of unusual encounters include the program crashing when a letter is entered where a number is required.
PROGRAM RUN RECORD Run your program and save the program test run session as follows: (a) click on File on the IDLE SHELL (not editor) main menu and (b) choose Save as ... then (c) change the Save as type to Text files (d) type the file name. You may wish to navigate to the folder where you want to save before (e) click on SAVE.