CJCoding With Joseph
15free / daySign inCreate account

York U ITEC 1620

Assignment 2

2025 - Winter

Question 1: Dice Game Simulation

Write a Java program to simulate a game of dice with three players. The game follows these rules:

  • Each player rolls two dice per turn.

  • The sum of the dice is added to their total score.

  • If a player rolls a doublet (both dice have the same value), they get another turn.

  • The first player to reach 15 or more points wins and the game will end.

  • The program should print the winners in order of their scores.

Requirements:

✅ Use loops and conditionals (Marks will be deducted for hardcoded output).
✅ No user input is required; the program should run automatically.

Members only

Keep reading this lesson

You've reached the end of the free preview. Unlock the rest of this lesson in York U ITEC 1620.

  • Unlimited coding questions
  • Unlimited access to all classroom material
  • Weekly live call for questions and guidance
  • 3,000 AI tutor tokens / month
  • Personal SQL database (3 MB)
  • Progress tracking

Cancel any time.