Need help with taylor series assignment!

closed account (4oS6URfi)
Hey guys I'm having trouble with this assignment for class, can someone please help me out? The assignment is involving taylor series sin(x) and cos(x). It basically has to do this:

MAIN MENU
1. To enter the data.
2. To calculate and approximate the sin(x)
3. To calculate and approximate the cos(x)
4. To modify data.
0. To quit.
Please make a choice: 2
You have to enter a value first!

MAIN MENU
1. To enter the data.
2. To calculate and approximate the sin(x)
3. To calculate and approximate the cos(x)
4. To modify data.
0. To quit.
Please make a choice: 3
You have to enter a value first!

MAIN MENU
1. To enter the data.
2. To calculate and approximate the sin(x)
3. To calculate and approximate the cos(x)
4. To modify data.
0. To quit.
Please make a choice: 4
You have to enter a value first!

MAIN MENU
1. To enter the data.
2. To calculate and approximate the sin(x)
3. To calculate and approximate the cos(x)
4. To modify data.
0. To quit.
Please make a choice: 9

Wrong choice. Only options 1-4 are available.

MAIN MENU
1. To enter the data.
2. To calculate and approximate the sin(x)
3. To calculate and approximate the cos(x)
4. To modify data.
0. To quit.
Please make a choice: k
Wrong choice. Only options 1-4 are available.

MAIN MENU
1. To enter the data.
2. To calculate and approximate the sin(x)
3. To calculate and approximate the cos(x)
4. To modify data.
0. To quit.
Please make a choice: 1
Please give a value for the angle: 1.24
Please give a value for the approximation order n: 7

MAIN MENU
1. To enter the data.
2. To calculate and approximate the sin(x)
3. To calculate and approximate the cos(x)
4. To modify data.
0. To quit.
Please make a choice: 2
The sine of x is: 0.945784
Using Taylor series it is: 0.945784

MAIN MENU
1. To enter the data.
2. To calculate and approximate the sin(x)
3. To calculate and approximate the cos(x)
4. To modify data.
0. To quit.
Please make a choice: 3
The cosine of x is: 0.324796 Using Taylor series it is: 0.324796

MAIN MENU
1. To enter the data.
2. To calculate and approximate the sin(x)
3. To calculate and approximate the cos(x)
4. To modify data.
0. To quit.
Please make a choice: 1
Please use the modify option to enter a new angle.

MAIN MENU
1. To enter the data.
2. To calculate and approximate the sin(x)
3. To calculate and approximate the cos(x)
4. To modify data.
0. To quit.
Please make a choice: 4
Old angle = 1.24
Old approximation = 7 Please give new angle: 1.10 Please give new n: 2

MAIN MENU
1. To enter the data.
2. To calculate and approximate the sin(x)
3. To calculate and approximate the cos(x)
4. To modify data.
0. To quit.
Please make a choice: 2
The sine of x is: 0.891207
Using Taylor series it is: 0.891588

MAIN MENU
1. To enter the data.
2. To calculate and approximate the sin(x)
3. To calculate and approximate the cos(x)
4. To modify data.
0. To quit.
Please make a choice: 3
The cosine of x is: 0.453596 Using Taylor series it is: 0.456004

MAIN MENU
1. To enter the data.
2. To calculate and approximate the sin(x)
3. To calculate and approximate the cos(x)
4. To modify data.
0. To quit.
Please make a choice: 0
Are you sure you want to quit? (Y/N): N

MAIN MENU
1. To enter the data.
2. To calculate and approximate the sin(x)
3. To calculate and approximate the cos(x)
4. To modify data.
0. To quit.
Please make a choice: 0
Are you sure you want to quit? (Y/N): Y

Now quitting..
Please note, that it is not a homework site. We won't do your homework for you. However we are always willing to help solve problems you encountered, correct mistakes you made in your code and answer your questions.

We didn't see your attemts to solve this youself and so we cannot correct mistakes you didn't made and answer questions you didn't ask. To get help you should do something yourself and get real problems with something. If your problem is "I don't understand a thing", then you should go back to basics and study again. As it is impossible to find deriviative of function without knowledge in ariphmetics, you cannot do more complex tasks in programming without clear understanding of basics
Topic archived. No new replies allowed.