Question: 8. Write a single (non-nested) Java statement that displays the following messages: Your shopping cart contains 5 items Assume that the variable n contains the

8. Write a single (non-nested) Java statement that displays the following messages: Your shopping cart contains 5 items Assume that the variable n contains the number of items. If n has the value 1, the statement should display the following message instead: Your shopping cart contains 1 item You may not use the if statement or switch statement. You statement must consist of a single call of system.out.println. Simply your answer as much as possible
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
