Question: Write a Python program that performs some arithmetic operations on two given numbers (entered by user) along with the following requirements. Define a function that
Write a Python program that performs some arithmetic operations on two given numbers (entered by user) along with the following requirements.
-
Define a function that takes two numbers, adds two numbers and returns the sum. The function must be templated so it works for floats.
-
Define a function that takes two numbers, multiplies the two numbers and returns the product. The function must be templated so it works for floats.
-
Define a function that takes two numbers; divides the first number by the second and returns the quotient. The function must be templated so it works for floats.
-
Define a function that takes two numbers, subtracts the second from the first and returns the difference. The function must be templated so it works for floats.
-
Define a function that takes two numbers, finds and returns the remainder of the first number divided by the second. The function must be templated so it works for floats.
-
Define a function that takes two numbers, finds the first to the power of the second number and returns the value. The function must be templated so it works for floats.
-
Define a function that takes a number and returns the square-root of the number. The function must be templated so it works for floats.
-
Prompt the user to enter two numbers
-
Call all the functions passing those two entered numbers and print the calculated results with proper descriptions
-
Write a test function to automatically test each function with at least two different test cases. (5*7 = 35 points)
-
Include a screenshot of manually testing of the program and update the README.md file with the status of the project and self grade.
-
Bonus 10 points - Write a function that finds and returns the larger of two given numbers. Call the function to test it with the same two numbers.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
