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

Write a C++ statement that declares a variable student_id, and assigns a value 1

ID: 3772668 • Letter: W

Question

Write a C++ statement that declares a variable student_id, and assigns a value 1602 to it. Write the explosion below at a C++ statement (Assume all variables are declared.) h^201 /K + 2 Write an if... else statement that assigns 1 to z if x is greater than y, otherwise it assigns 20 to z. (Assume all variables are declared) Rewrite the if... else statement in pan c) using a conditional operator. Write C++ statements that declares a variable indata for file input and opens a text file named demo.

Explanation / Answer

1. int studentid=1602; (we will use an integer value for student id)

2) float h,

    float k;

float m,

m= ((h^201))/(k+2) ;

3. int x;

int y;

int z;

if(x>y)

z=1;

else

z=20;

4) using the conditional operator. z= (x>y) ? 1 : 20

5)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote