โ Back to Miscellaneous
Question 156
Enum Switch Shipping Cost
Enum Switch Shipping Cost
Use an enum and a switch statement to determine and print a shipping cost based on the selected method. Expected Output: Cost: 15 The enum Shipping is already defined. Set the method to EXPRESS, then write a switch statement to assign costs: STANDARD = 5, EXPRESS = 15, OVERNIGHT = 25. In a switch on an enum, write case EXPRESS: not case Shipping.EXPRESS:
Expected Output:
Cost: 15
Topics:
Miscellaneous
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (sysout, psvm, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.