Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package h02;
- public class Program {
- /**
- * Teine JOOP praktikum.
- *
- * Mikk Kirstein
- * 093386IAPB
- * IAPB41
- *
- * @param args
- */
- public static void main(String[] args) {
- // Pilet 2€
- // Võidufond suureneb 1€
- // 10/(võitjate arv) + (ostetud piletite arv) = võidusumma €
- // Constructor(String name, int LotteryTicketPrice, int AmmountThatGoesIntoJackPot, int cashThatWinnerGets)
- Lottery l1 = new Lottery("Beginners luck", 2, 1, 20);
- Lottery l2 = new Lottery("Tough luck", 5, 2, 5);
- // Constructor(int firstNr, int secondNr)
- l1.gamble(1, 2);
- l1.gamble(2, 3);
- l1.gamble(4, 2);
- l1.gamble(4, 2);
- l1.gamble(4, 2);
- l1.gamble(4, 2);
- l1.gamble(1, 1);
- l1.gamble(1, 1);
- l1.gamble(1, 1);
- l1.gamble(4, 2);
- l1.gamble(4, 2);
- l1.gamble(4, 2);
- l1.gamble(4, 2);
- l1.gamble(4, 2);
- l1.gamble(2, 4);
- l1.gamble(4, 2);
- l1.calculateProfit();
- l2.gamble(4, 2);
- l2.gamble(6, 1);
- l2.gamble(1, 7);
- l1.raffleJackpot();
- l1.calculateProfit();
- l2.raffleJackpot();
- l2.calculateProfit();
- l1.checkTicket(4);
- l2.checkTicket(16);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement