joseleonweb

Untitled

Jan 29th, 2021
563
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2. import java.util.Random;
  3.  
  4. public class Lottery {
  5.  
  6.     public static void main(String[] args) {
  7.         Scanner keyboard = new Scanner(System.in);
  8.         System.out.print("Enter a number between 1 and 10: ");
  9.         int userNum = keyboard.nextInt();
  10.         Random rndNum = new Random();
  11.         int winningNum = rndNum.nextInt(10)+1;
  12.         System.out.println("Your number: " + userNum);
  13.         System.out.println("The winning number is: " + winningNum);
  14.     }
  15. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×