Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using PyCharm (Python) perform the following: Your program must have a header. Use the programming style guide for guidance. This program will perform various calculations
Using PyCharm (Python) perform the following:
- Your program must have a header. Use the programming style guide for guidance.
- This program will perform various calculations (addition, subtraction, multiplication, division, and average calculation)
- This program will contain a variety of loops and functions.
- The program will add, subtract, multiply, divide two numbers and provide the average of multiple numbers input by the user.
- Define a function named performCalculation which takes one parameter. The parameter will be the operation being performed (+, -, *, /).
- This function will perform the given prompt the user for two numbers then perform the expected operation depending on the parameter that's passed into the function.
- This function will print the calculated value for the end user.
- Define a function named calculateAverage which takes no parameters.
- This function will ask the user how many numbers they wish to input.
- This function will use the number of times to run the program within a for loop in order to calculate the total and average.
- This function will print the calculated average.
- This program will have a main section which contains a while loop. The while loop will be used to allow the user to run the program until they enter a value which ends the loop.
- The main program should prompt the user for the operation they wish to perform.
- The main program should evaluate the entered data using if statements.
- The main program should call the necessary function to perform the calculation.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started