Using Java, write a program that rolls 3 20-sided die and adds them together. Make sure to display their output so you can use it in your Dungeon and Dragons game.
Sample output 1: You rolled a 60.
Sample output 2: You rolled a 3.
import java.util.Random;
public class DungeonAndDragons {
public static void main(String[] args) {
Random random = new Random();
int d1 = 1+random.nextInt(20);
int d2 = 1+random.nextInt(20);
int d3 = 1+random.nextInt(20);
System.out.println("You rolled a " + (d1+d2+d3) + ".");
}
}
Using Java, write a program that rolls 3 20-sided die and adds them together. Make sure...