Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class ArcadeMain {
- public static void main(String[] args) {
- int money;
- Scanner scan = new Scanner(System.in);
- Card card1 = new Card();
- Card card2 = new Card();
- System.out.println("Welcome to the arcade, how much money would you like to add to card 1: ");
- money = scan.nextInt();
- while (money < 1) {
- System.out.println("Please enter a valid amount: ");
- money = scan.nextInt();
- }
- card1.setCredits(money * 2);
- card1.setTickets(0);
- card1.setID((int)(Math.random() * ((10 - 1) + 1)) + 1);
- System.out.println("How much money would you like to add to card 2: ");
- money = scan.nextInt();
- while (money < 1) {
- System.out.println("Please enter a valid amount: ");
- money = scan.nextInt();
- }
- card2.setCredits(money * 2);
- card2.setTickets(0);
- card2.setID((int)(Math.random() * ((20 - 11) + 1)) + 11);
- System.out.println("You're ready to start playing our famous coin pusher game");
- System.out.println("Enter 1 to swipe card1 or card 2, 0 to stop
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement