Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

may I get help with part c e-mail: vunnikrishnan @eng.ua.edu Tel: 348-5193 Time:

ID: 3585357 • Letter: M

Question

may I get help with part c


e-mail: vunnikrishnan @eng.ua.edu Tel: 348-5193 Time: T,Th: 12.30 PM 1.45 PMM Due: Online & In Class 12.30 PM - October 3d 2017 Total 20 Points ASSIGNMENT 3 m - 1: The series expansion for cos, and sin, functions and trigonometric identities are as follows (x in radians) 20 Points sin(2a) 2sin a cosa cos(2x) = cos2-sin2 2 a. Write a C++ program that calculates the value of the series sin z and cos z, sin 2r or cos 2z where the user enters the value of r (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 r. The program should use switch statements to determine the choice sin r and cos z, sin 2r or cos 2a. (Note: you may have to convert 7 Points degrees to radians for sin and cos functions). 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 4 Points ing (sor "e code) c. Now carry out a convergence study for n 1...7 for a given value of z and plot the convergence graph (you 4 Points Problem 2: Write C++ nested if statements corresponding to the conditions illustrated in Figure 1. You may can use M.S. Exeel or MATLAB to plot ). provide only the necessary else statements and can assume that the variables have been declared previously. 5 Points 3 Figure 1: Represent using nested if statements 19th Sept, 20

Explanation / Answer

The following code in C++ gives you the required code for given nested if-else flow chart:

#include<iostream>
using namespace std;
int main()
{
char grade;
int weight,bin,t,s,a;
if(grade=='A')
{
if(weight>35)
{
bin = 1;
}
else
{
t = s + a;
}
}
else
{
//..bunch of statements
}
return 0;
}

Hope it helps, do give your valuable response.