Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How do I start and what do I do to make this a a C++ program? 1. Problem Statement: The goal of this programming assignment

image text in transcribed

image text in transcribed

image text in transcribed

How do I start and what do I do to make this a a C++ program?

1. Problem Statement: The goal of this programming assignment is to give students experience with iteration in C++. In particular, your task will be to write a program that uses loops to calculate and print the value of sin(x) and cos(x) using the first N terms of their Taylor's series expansions. As you know from Calculus, the accuracy of these approximations improves as you add higher order terms. Your program will demonstrate this fact by creating several tables that show the values of sin(x) and cos(x) with increasing number of Taylor's series terms. Your specific program requirements are listed below User Input: Prompt the user to enter the value of x (the angle in radians for the sin(x) and cos(x) calculations) and read this value into a variable *Prompt the user for the value of N (the number of terms to be included in the Taylor's series expansion) and read this value into a variable. You should do error correction on the value of N to make sure the user types in a value of N 1 * Print First Table: Use iteration to print a table the values of n, n! and x" for values n from 1 to N For example, if x=0.1 and N=5 your table should look something like this 0.01 0.001 24 0.0001 120 0.00001 Print sin(x) Table: The Taylor's series for sin(x) is given by the following. sin(x) - xetc Use iteration to print a table of the values of n, xn! and the Taylor's series approximation of sin(x) that includes terms up to x"! Remember the formula for sin(x) only contains the terms with ODD values of n You should format your table in columns something like the first table. * Perform sin(x) Accuracy Test: * After you print the sin(x) table, you should have the value for sin(x) with all terms up to N in a variable. .Calculate the true value of sin(x) using the function in the library, and calculate the error in your estimate by subtracting the truth

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2012 Internals And Troubleshooting

Authors: Christian Bolton, Justin Langford

1st Edition

1118177657, 9781118177655

More Books

Students also viewed these Databases questions