Identify and correct the errors in each of the following statements (assume that the state- ment using std::cout; is used):
```
a) if (c < 7); {
cout << "c is less than 7\n";
}
b) if (c => 7) {
cout << "c is equal to or greater than 7\n";
}
```
a. Error: Semicolon after the right parenthesis of the condition in the if statement.
Correction: Remove the semicolon after the right parenthesis. [Note: The result of this error is that the output statement executes whether or not the condition in the if statement is true.] The semicolon after the right parenthesis is an empty statement that does nothing.
b. Error: The incorrect relational operator =>.
Correction: Change => to >=, and you may want to change “equal to or greater than”to “greater than or equal to” as well.
You might also like to view...
What is a suitable way of telling the user that input was accepted?
What will be an ideal response?
The recommended minimum number of Active Directory domain controllers in a domain environment is three.
Answer the following statement true (T) or false (F)
A mobile device user is concerned about geographic positioning information being included in messages sent between users on a popular social network platform.The user turns off the functionality in the application, but wants to ensure the application cannot re-enable the setting without the knowledge of the user.Which of the following mobile device capabilities should the user disable to achieve the stated goal?
A. Device access control B. Location based services C. Application control D. GEO-Tagging
What is the first and arguably one of the most important steps of the risk management process?
A. Assess risks B. Identify assets C. Assess vulnerabilities D. Identify threats E. Mitigate risks