1. Learn
  2. /
  3. Courses
  4. /
  5. Intermediate Java

Connected

Exercise

Dice game

You are hoping to develop a video game based on dice throwing. To that end, you want to implement a workflow that is going to give different outputs depending on the dice's result. A critical hit happens when the die shows 20.

Instructions

100 XP
  • Use the correct operator to make sure that the result is 20 before printing.
  • Surround the operator in the right way to print only if the result is lower or equal to 10.