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 04:00
Chloe is building a kiosk-based excel application. she wants to make some modifications to the screen elements in order to keep users from being distracted by parts of the application that are irrelevant to her application. she turns to henry for guidance as she knows he built a similar solution earlier this year.chloe has decided to hide the worksheet gridlines and the vertical scroll bar. what does henry tell her to use to do this? a) screen elements dialog boxb) display options dialog boxc) customization dialog boxd) excel options dialog box
Answers: 2
question
Computers and Technology, 22.06.2019 14:00
What are procedures that keep a data base current
Answers: 1
question
Computers and Technology, 23.06.2019 15:30
1. ask the user how many questions are in the quiz. 2. ask the user to enter the key (that is, the correct answers). there should be one answer for each question in the quiz, and each answer should be an integer. e.g., 34 7 13 100 81 3 9 10 321 12 might be the key for a 10-question quiz. you will need to store the key in an array. 3. ask the user to enter the answers for the quiz to be graded. there needs to be one answer for each question. note that these answers do not need to be stored; each answer can simply be compared to the key as it is entered. 4. when the user has entered all of the answers to be graded, print the number correct and the percent correct. 5. add a loop so that the user can grade any number of quizzes with a single key. after the results have been printed for each quiz, ask "grade another quiz? (y/n)." note: you only have one array (the key). you are not creating a new key for each set of quiz answers.
Answers: 3
question
Computers and Technology, 23.06.2019 16:30
Which of the following is not an enhancement to the standard wiki to make it more attractive for corporations? encryptionwork spacespermission toolspredictive text
Answers: 2
You know the right answer?
You will use conditionals, loops, and functions to implement a trigonometric functions calculator....
Questions
question
Mathematics, 03.03.2021 04:20
question
Mathematics, 03.03.2021 04:20
question
Mathematics, 03.03.2021 04:20
question
Business, 03.03.2021 04:20