Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class mathrandom {
- protected static Scanner sc = new Scanner(System.in);
- public static void main(String[] arg) {
- System.out.println("Would you like to throw the dice?" +
- "\n1.Yes, please\n2.No thanks");
- int dice = sc.nextInt();
- if(dice == 1) {
- int nr;
- nr = (int)(Math.random()*6+1);
- System.out.println("You got number "+nr);
- }
- else if(dice == 2){
- System.out.println("What ever ");
- }
- else {
- System.exit(0);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement