Question: I need to generate a simple java program to determine who will go first in a game of any amount of players. A die is

I need to generate a simple java program to determine who will go first in a game of any amount of players.

A die is rolled and whoever rolls the largest number goes first.

How do I do this? I have this so far..

Scanner kbd = new Scanner(System.in); while (true) int die = (int)(Math.random()*6 + 1); //die roll between 1 and 6 highest number will go first System.out.println("Roll: total = " + die); int playern; if (playern > playern-1) { System.out.println("player n goes first ");

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!