Using Java Write Program Rolls 3 20 Sided Die Adds Together Make Sure Display Output Use D Q37125640

Using Java, write a program that rolls 3 20-sided die and addsthem together. Make sure to display their output so you can use itin your Dungeon and Dragons game.

Sample output 1: You rolled a 60.

Sample output 2: You rolled a 3.


Solution


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

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.