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

Evaluate the following statements. In each case, state what value would be store

ID: 3772701 • Letter: E

Question

Evaluate the following statements. In each case, state what value would be stored in each variable after each statement are executed in sequences, (This means that the value you obtain in the first line will affect the next line and so on.) If a variable does not have after the statements are executed, report undefined (UND). Suppose a, b and c are int variables where a = 3 and b = -1. Write some nested if C++ statements that outputs you get a bonus if employment _ years is greater than or equal to 3 and profits _ gained is greater than or equal to 10000. (Assume all variables are declared.) Rewrite the nested if statement in a) using only one if statement with the appropriate logical operator.

Explanation / Answer

3.
a*=(b--)+6;
it retruns a value 12

=====
c=3*b+(++a)

c value 7

=====
b+=2*(c--)-(a++)
it returns b value
-4

======
a/=a%(c+ ++b)

it returns a value 0

4.
a)

if(employment_years>=3){
if(profits_gained>=10000){
cout<<"You get a bonus";
}
}

b)

if(employment_years>=3&&profits_gained>=10000){
cout<<"You get a bonus";
}

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