Question: write a python code that does the following: After you have finished the file muMath, create another Python file called muMathTest. Inside muMathTest, do the

write a python code that does the following:
After you have finished the file muMath, create another Python file called muMathTest.
Inside muMathTest, do the following:
a) It should import muMath
b) It should contain a menu function with the following options:
1. Find the square root
2. Compute x to the nth power
3. Sum of first n integers
4. QUIT
See slide 43(Power Point numbering) from Week 9 Lecture 2 for guidance
c) You should provide a loop (for example, while menuChoice !=4: ) that allows
the user to do as many calculations as he/she desires.
d) If the user enters option 1, ask the user to enter a number. Use muSqrt to find and print
the square root of the number the user entered.
e) If the user enters option 2, ask the user to enter x and n. Use muPower to compute x to
the nth power. Remember, your program should work for n being 0 or n being negative
as well as for positive values of n. Remember x-n is 1/xn
f) If the user enters option 3, ask the user to enter an integer, say n. Use sumToN to find
and print the sum of the first n integers.

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 Programming Questions!