Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!