33.5k views
5 votes
After the following code is executed what will be displayed on the screen? bool correntEmployee = true; double empSalary = 45000; if (correntEmployee) { if (empSalary < 45000) cout << "The employee needs a pay raise.\\"; else cout << "The employee pay rate is normal.\\"; } else cout << "This person is not an employee.\\";

User T Porter
by
8.2k points

1 Answer

6 votes

Answer:

"The employee pay rate is normal" is the correct answer for the above question.

Step-by-step explanation:

  • The above question code is written in the c++ language, in which there is one variable of bool type whose value is true.
  • And this variable is also tested in the if-condition which gives the true and the if-body will be executed.
  • Then the internal if-condition will give the false result because the value of the empsalary is not less than 45000. It is because the above statement "empsalary=45000" will assign the value 45000 on the empsalary variable.
  • Then the else block will be executed which prints "the employee pay rate is normal".

User Amit Patel
by
8.3k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.