Question
Due: Online & In Class 12.30 PM - October 3"d 2017 Total 20 Points ASSIGNMENT 3 Problem 1: The series expansion for cos, and sin, functions and trigonometric identities are as follows (r in radians) 20 Points sin(2x) = 2sinz cosz cos(2x) cos2 x-sin a. Write a C++ program that calculates the value of the series sin r and cos z, sin 2r or cos 2z where the user enters the value of z (in degrees) and n the number of terms in the series. For example, if n = 5, the program should calculate the sum of 5 terms in the series for a given values of s. The program should use suwitch nts to determine the choice sin a degrees to radians for sin and cos functions). 7 Pointa b. Draw a detailed flow chart on how this program is designed, indicating the necessary inputs, outputs and the algorithm you have used. The flow chart should be included in the document file along with your program Points listing (source code). c. Now carry out a convergence study for n = 1 7 for a given value of z and plot the convergence graph you Points Problem 2: Write C++ nested if statements corresponding to the conditions illustrated in Figure 1. You may can use M.S. Excel or MATLAB to plot ). provide only the necessary else staternents and can assume that the variables have been declared previously. Points Figure 1: Represent using nested if statements 19th Sept, 20 854 PM
Explanation / Answer
//Problem 2
//c++ nested if statement
if(grade=='A'){
if(weight>35)
{
bin=1;
}
t=s+a;
}