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

The ) operator is the logical AND operator. It takes two Boolean expressions as

ID: 3752939 • Letter: T

Question

The ) operator is the logical AND operator. It takes two Boolean expressions as operands and creates a compound Boolean expression that is true only when both subexpressions are true. (Gaddis 225) The 11operator is the logical OR operator. It takes two Boolean expressions as operands and creates a compound Boolean expression that is true when either of the subexpressions is true (Gaddis 226). The operator is the logical NOT operator. It is a unary operator that takes a Boolean expression as its operand and reverses its logical value. In other words, if the expression is true, the operator returns false, and if the expression is false, the operator returns true(Gaddis 227) private void demoButton Click 1Cobject sender, EventArgs e) int quantity int.Parse(quantityTextbox. Text) double discount-0 if (quantity2 11 quantity3) 7 discount 0.05; 10 else if Cquantity> 4&& quantity!-6) discount 0.10; 12 13 14 15 MessageBox.Show("Your discount is + discount); For each value of quantity determine what value of discount will appear in the MessageBox. unable to determine MacBook Ai

Explanation / Answer

Output for the following Cases:

1) When input=1: it prints "unable to determine", because none of the conditions have been executed for the given input.

2) When input=2: here the First if condition is matched and gets evaluated to TRUE. So, it prints Your discount is 0.05

3) When input=3: here also the First if condition is matched and gets evaluated to TRUE. So, it prints Your discount is 0.05

4) When input=5: here the Second if condition is matched and gets evaluated to TRUE. So, it prints Your discount is 0.10

5) When input=6: it prints "unable to determine", because none of the conditions have been executed for the given input.

6) When input=88: it prints "unable to determine", because none of the conditions have been executed for the given input.