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

C++ Follow the class programming rules for writing a C-program in our class: var

ID: 640188 • Letter: C

Question

C++

Follow the class programming rules for writing a C-program in our class: variables should be mnemonic and should be 3 characters or more. First, the program should use a printf statement that gives a brief explanation of the term pseudo code. Next the program should perform the steps given by the pseudo code.

Note: It is required for this program to use the math header file (math library) in the program and to use math built in functions found there to complete the program output.

Use values of x = 9.1 and y = 7.3.

Use Joe as the variable for the first total (#5) and

use Red as the variable for the second total (#6)

Given the following pseudo code, write a program that executes it.

Use floating-point types for all values.

1. read x

2. read y

3. compute p = cos(x * y)

4. compute s = ln(x + y)

5. 1 st total: Joe = s 4 + p * (s

Explanation / Answer


#include<iostream>
#include<math.h>
using namespace std;

int main()
{
   float x,y,Joe,Red,p,s;

   printf(" Enter x: ");
   scanf("%f",&x);
   printf(" Enter y: ");
   scanf("%f",&y);

   p=cos(x*y);
   s=log(x+y);

   Joe = 4*s + p*(s-x)*exp(p+y);

   Red = sqrt(Joe);

   printf(" Joe (s4+p*(s