Question: The programs you will write for this project are copied with permission, or adapted from, the exercises in A Beginner s Python Tutorial. Each program
The programs you will write for this project are copied with permission, or adapted from, the exercises in A Beginners Python Tutorial.
Each program should be written, tested, and debugged. The first two programs should also be fully commented, with each line documented by a descriptive comment. The remaining programs should have a single comment line at the beginning to describe the function of the program. All programs should start with a display of your name, student id# and the program number and name. When storing the files, name them as progpy progpy etc.
Example of AuthorProgram Information Output
Program author: B Rubble
ID#:
Program Math Functions
Program Math Functions
Write an algorithm for a program that shows the use of all six math functions. Write, test, and debug the program using Python.
SAMPLE OUTPUT not including authorprogram information
ADDITION:
SUBTRACTION:
MULTIPLICATION:
DIVISION:
EXPONENT:
REMAINDER:
Program Using Input
Write an algorithm for a program that receives, as input from the user, string variables and integer variables; then joins together and displays the combined strings; and finally multiplies the two numbers on a new line. Write, test, and debug the program using Python.
SAMPLE OUTPUT not including authorprogram information
Input string Billy
Input String Bob
Input integer A
Input integer B
BillyBob
Program Loops and If Conditions
Write a program that requests a password after the authorprogram information is displayed. Make the password "hello". The program should then ask the user for their name: if the name entered is the same as your name, the program should respond with "What a great name!"; if they enter "Madonna" or "Cher", the program should respond "May I have your autograph, please?". For any other input, the program should respond with input name thats a nice name".
SAMPLE OUTPUT including authorprogram information
Program author: Barney Rubble
ID#:
Program LOOPS AND IF CONDITIONS
Password? unicorn
Password? opus
Password? hello
Welcome to the second half of the program!
What is your name? Barney
What a great name!
ALTERNATE OUTPUTS
What is your name? Cher
May I have your autograph, please?
What is your name? Bill
Bill, thats a nice name.
Program Functions
Rewrite the area.py program shown below, or in the Creating Functions section of the tutorial so that it has separate functions for the perimeter and area of a square, a rectangle, and a circle radius This program should include a menu interface that has exit the program as one of its choices.
SAMPLE PROGRAM EXECUTION
Area.py
#This program calculates the perimeter and area of a rectangle
print "Calculate information about a rectangle"
length inputLength:
width inputWidth:
print "Area",lengthwidth
print "Perimeter",lengthwidth
SAMPLE OUTPUT not including authorprogram information
CALCULATIONS MENU
AREA SQUARE
AREA RECTANGLE
AREA CIRCLE
PERIMETER SQUARE
PERIMETER RECTANGLE
PERIMETER CIRCLE
EXIT
INPUT MENU CHOICE OR
YOU HAVE CHOSEN AREA RECTANGLE
INPUT WIDTH?
INPUT LENGTH?
AREA IS
INPUT MENU CHOICE?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
