Chapter 3: Problem 4
Write an if statement that sets the variable fees to 50 if the boolean variable max is true..
Chapter 3: Problem 4
Write an if statement that sets the variable fees to 50 if the boolean variable max is true..
All the tools & learning materials you need for study success - in one app.
Get started for freeWrite an if-else statement that assigns 20 to the variable \(y\) if the variable \(x\) is greater than \(100 .\) Otherwise, it should assign 0 to the variable \(y\).
What is a constructor?
Write an if-else statement that assigns 0 to the variable b and assigns 1 to the variable c if the variable a is less than 10. Otherwise, it should assign -99 to the variable \(b\) and assign 0 to the variable \(c\).
Write an if statement that assigns 0.2 to commission if sales is greater than or equal to 10000.
Rewrite the following if-else-if statement as a switch statement. if (selection == 'A') System.out.println("You selected A."); else if (selection == 'B') System.out.println("You selected B."); else if (selection == 'C') System.out.println("You selected C."); else if (selection == 'D') System.out.println("You selected D."); else System.out.println("Not good with letters, eh?");
What do you think about this solution?
We value your feedback to improve our textbook solutions.