Computer Science, asked by Anonymous, 6 months ago

Write a program to stimulate 4 rolls of a single die to generate an integer value from 1 to 6.

Answers

Answered by 79sudha836
0

Explanation:

I hope it's clear pls mark me as brainliest

Attachments:
Answered by Itzraisingstar
9

Answer:

Explanation:

public class Random

{

  void generate()

   

  {

       int min=1,max=6,value;

       int range=max-min+1;

       //Roll 1

       value =(int)((Math.random()*range)+min);

       system.out.println("Roll 1:"+value);

       //Roll 2

       value=(int)((Math.random()*range)+min);

       System.out.println("Roll2:"+value);

       //Roll 3

       value-(int)((Math.random()*range)+min);

       System.out.println("Roll3:"+value);

        //Roll 4

       value=(int)((Math.random()*range)+min);

       System.out.println("Roll4:"+value);

  }

}          

Similar questions