Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.03 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class ArcadeMain {
  4.     public static void main(String[] args) {
  5.         int money;
  6.         Scanner scan = new Scanner(System.in);
  7.         Card card1 = new Card();
  8.         Card card2 = new Card();
  9.         System.out.println("Welcome to the arcade, how much money would you like to add to card 1: ");
  10.         money = scan.nextInt();
  11.         while (money < 1) {
  12.             System.out.println("Please enter a valid amount: ");
  13.             money = scan.nextInt();
  14.         }
  15.         card1.setCredits(money * 2);
  16.         card1.setTickets(0);
  17.         card1.setID((int)(Math.random() * ((10 - 1) + 1)) + 1);
  18.        
  19.         System.out.println("How much money would you like to add to card 2: ");
  20.         money = scan.nextInt();
  21.         while (money < 1) {
  22.             System.out.println("Please enter a valid amount: ");
  23.             money = scan.nextInt();
  24.         }
  25.         card2.setCredits(money * 2);
  26.         card2.setTickets(0);
  27.         card2.setID((int)(Math.random() * ((20 - 11) + 1)) + 11);
  28.        
  29.         System.out.println("You're ready to start playing our famous coin pusher game");
  30.         System.out.println("Enter 1 to swipe card1 or card 2, 0 to stop
  31.     }
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement