Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.13 KB | None | 0 0
  1. package h02;
  2.  
  3. public class Program {
  4.  
  5.     /**
  6.      * Teine JOOP praktikum.
  7.      *
  8.      * Mikk Kirstein
  9.      * 093386IAPB
  10.      * IAPB41
  11.      *
  12.      * @param args
  13.      */
  14.     public static void main(String[] args) {
  15.         // Pilet 2€
  16.         // Võidufond suureneb 1€
  17.         // 10/(võitjate arv) + (ostetud piletite arv) = võidusumma €
  18.    
  19.         // Constructor(String name, int LotteryTicketPrice, int AmmountThatGoesIntoJackPot, int cashThatWinnerGets)
  20.         Lottery l1 = new Lottery("Beginners luck", 2, 1, 20);
  21.         Lottery l2 = new Lottery("Tough luck", 5, 2, 5);
  22.    
  23.         // Constructor(int firstNr, int secondNr)
  24.         l1.gamble(1, 2);
  25.         l1.gamble(2, 3);
  26.         l1.gamble(4, 2);
  27.         l1.gamble(4, 2);
  28.         l1.gamble(4, 2);
  29.         l1.gamble(4, 2);
  30.         l1.gamble(1, 1);
  31.         l1.gamble(1, 1);
  32.         l1.gamble(1, 1);
  33.         l1.gamble(4, 2);
  34.         l1.gamble(4, 2);
  35.         l1.gamble(4, 2);
  36.         l1.gamble(4, 2);
  37.         l1.gamble(4, 2);
  38.         l1.gamble(2, 4);
  39.         l1.gamble(4, 2);
  40.        
  41.         l1.calculateProfit();
  42.        
  43.         l2.gamble(4, 2);
  44.         l2.gamble(6, 1);
  45.         l2.gamble(1, 7);
  46.        
  47.         l1.raffleJackpot();
  48.         l1.calculateProfit();
  49.         l2.raffleJackpot();
  50.         l2.calculateProfit();
  51.        
  52.         l1.checkTicket(4);
  53.         l2.checkTicket(16);
  54.         }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement