Chapter 4: Problem 5
In an if/else statement, the if part executes its statement(s) if the expression is __________, and the else part executes its statement(s) if the expression is __________.
Chapter 4: Problem 5
In an if/else statement, the if part executes its statement(s) if the expression is __________, and the else part executes its statement(s) if the expression is __________.
All the tools & learning materials you need for study success - in one app.
Get started for freeWrite one or more \(\mathrm{C}++\) statements that assign the correct value to discount, using the logic described here: Assign .20 to discount if dept equals 5 and price is \(\$ 100\) or more. Assign .15 to discount if dept is anything else and price is \(\$ 100\) or more. Assign .10 to discount if dept equals 5 and price is less than \(\$ 100\). Assign .05 to discount if dept is anything else and price is less than \(\$ 100\).
Write a \(C++\) statement that prints the message "The number is valid." if the variable grade is within the range 0 through 100 .
The trailing else in an if/else if statement has a similar purpose as the __________ section of a switch statement.
If the sub-expression on the left of the && logical operator is __________, the right sub-expression is not checked.
Write an if/else statement that assigns 0 to x when y is equal to 10. Otherwise it should assign 1 to x.
What do you think about this solution?
We value your feedback to improve our textbook solutions.