subject

You will use conditionals, loops, and functions to implement a trigonometric functions calculator. THE PROBLEM
You must complete the provided Python program to calculate three trigonometric functions based on the user's input. The user can select the following trigonometric functions: 1. Sine, 2. Cosine, and 3. Tangent. The user will input option 4 to exit the program. If the user inputs a number different than 1, 2, 3, or 4, your program must print into the display the following message: Invalid option. Your program will keep asking the user for an option until the user choice is 4 (exit).
Trigonometric functions:
Sine: to calculate the sine of an angle (in radians), you must use the following Maclaurin series (Wikipedia):
sin(x) = ∑[infinity]n=0(−1)nx2n+1(2n+1)!∑n=0 [infinity](−1)nx2n+1(2n+1)!
Where x is the value of the angle in radians.
Cosine: to calculate the cosine of an angle (in radians), you must use the following Maclaurin series (Wikipedia):
cos(x) = ∑[infinity]n=0(−1)nx2n(2n)!∑n=0[inf inity](−1)nx2n(2n)!
Tangent: For the value of an angle different than 90 or 270 (in degrees), the tangent is:
tan(x) = sin(x)cos(x)sin(x)cos(x)
Where x is the value of the angle in radians.
User-defined Functions:
You must write the definition of the following functions:
factorial: this function receives as a parameter an integer value and returns the factorial of the received value. For a parameter equal to 5, the function returns 120 (5 * 4 * 3 * 2 * 1).
sin: this function receives two parameters (a float representing the value of the angle in radians and an integer value representing the number of terms of the Maclaurin series to be calculated). The function returns the value of the sine of the first parameter calculated with the first n terms of the Maclaurin series for the sine (where n is the second parameter received by the function).
cos: this function receives two parameters (a float representing the value of the angle in radians and an integer value representing the number of terms of the Maclaurin series to be calculated). The function returns the value of the cosine of the first parameter calculated with the first n terms of the Maclaurin series for the cosine (where n is the second parameter received by the function).
degTorad (provided): this function receives as a parameter an integer value representing an angle in degrees and returns the value of the received angle in radians.
printMenu (provided): this function does not receive parameters and does not return a value. The function prints the to STDOUT (display) the menu to be used by the user.
Main program:
The main program is provided in the template file. Please use the comments in the template file to complete your solution.
Input:
Your program takes as initial input one integer value representing the menu option. If the initial input value is a trigonometric function (1, 2, or 3), the program will request two additional inputs (an integer value representing an angle in degrees and the number of terms used in the Maclaurin series). The input statements are provided in the template file.
Output:
The print statements are provided in the template file (do not modify the output messages).
Note:
You can safely assume that the input will always be valid.
Example :
THE TRIGONOMETRIC CALCULATOR
1 - Calculate the sine of a value
2 - Calculate the cosine of a value
3 - Calculate the tangent of a value
4 - Exit
Enter your option: 1
Enter the value (in degrees): 45
Enter the number of terms: 10
The sine of 45 is 0.7071
THE TRIGONOMETRIC CALCULATOR
1 - Calculate the sine of a value
2 - Calculate the cosine of a value
3 - Calculate the tangent of a value
4 - Exit
Enter your option: 2
Enter the value (in degrees): 45
Enter the number of terms: 10
The cosine of 45 is 0.7071
THE TRIGONOMETRIC CALCULATOR
1 - Calculate the sine of a value
2 - Calculate the cosine of a value
3 - Calculate the tangent of a value
4 - Exit
Enter your option: 3
Enter the value (in degrees): 45
Enter the number of terms: 10
The tangent of 45 is 1.0000
THE TRIGONOMETRIC CALCULATOR
1 - Calculate the sine of a value
2 - Calculate the cosine of a value
3 - Calculate the tangent of a value
4 - Exit
Enter your option: 4

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:30
To hide gridline when you display or print a worksheet
Answers: 1
question
Computers and Technology, 23.06.2019 12:00
If you embed a word table into powerpoint, what happens when you make edits to the embedded data? a. edits made to embedded data change the data in the source file; however, edits made to the source file will not be reflected in the embedded data. b. edits made to embedded data will change the data in the source file, and edits made to the source file will be reflected in the embedded data. c. edits made to embedded data don't change the data in the source file, nor will edits made to the source file be reflected in the embedded data. d. edits made to embedded data don't change the data in the source file; however, edits made to the source file will be reflected in the embedded data.
Answers: 1
question
Computers and Technology, 24.06.2019 11:30
What does the https: // mean when you type in a website
Answers: 1
question
Computers and Technology, 24.06.2019 19:50
Which is a characteristic of free and open-source software licenses? a. the source code is unavailable to everyone b. the source code is available only to the government c. the source code is available to all users d. the source code is constantly modified
Answers: 1
You know the right answer?
You will use conditionals, loops, and functions to implement a trigonometric functions calculator....
Questions
question
Mathematics, 14.01.2021 14:00
question
History, 14.01.2021 14:00
question
Law, 14.01.2021 14:00
Questions on the website: 13722367