Question: The following is the Taylor series approximation for computing the sine function for a given angle x in radians: x? sin(x) X- x 3! xs

 The following is the Taylor series approximation for computing the sinefunction for a given angle x in radians: x? sin(x) X- x

The following is the Taylor series approximation for computing the sine function for a given angle x in radians: x? sin(x) X- x 3! xs + 5! 7! Write a Python program that asks the user to input an angle in radians and prints its sine value using both the above Taylor series approximation and the sine function from the math module. The program also prints the approximation error up to 6 significant digits. (Hint: math module has a factorial function) Sample Run Enter an angle x in radians: 1.5 Using Taylor series approximation, sin( 1.5 ) = 0.9973911830357143 Using math function, sin( 1.5 ) = 0.9974949866040544 Approximation error = 0.000104 In [ ]: #%%writefile HW0201.py ## Uncomment the above line after you finish your code, in order to generate the Python submission file. # YOUR CODE HERE Write a python program that computes the zakat, obligatory charity, on sheep. The program asks the user to input the number of sheep, and then the zakat is calculated based on the following schedule: Zakat Amount The number of sheep ranging From 1 39 40 120 121 200 201 399 No zakat 1 sheep 2 sheep 3 sheep 4 sheep 400 499 500 599 5 sheep Same pattern as the last two rows Notes: Make sure that the input value is a positive integer. If not, the program must print the following message: "Wrong input. Number should be an integer greater than 0", and then terminate. . Using loops in solving this question is not allowed. Sample Runs Please enter the number of sheep: -3 Wrong input. Number should be an integer greater than 0 Please enter the number of sheep: 24 The zakat amount = 0 sheep Please enter the number of sheep: 119 The zakat amount = 1 sheep Please enter the number of sheep: 618 The zakat amount = 6 sheep In [ ]: #XXivritefile HW0202.py ## Uncomment the above Line after you finish your code, in order to generate the Python submission file. # YOUR CODE HERE

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!