Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need the complete program for this one. I posted it twice already and expects

ID: 3606314 • Letter: I

Question

I need the complete program for this one. I posted it twice already and expects are giving me what I already have. PLEASE DON'T JUST COPY WHAT I HAVE AND SUBMIT IT BACK! THANK YOU!

Assignment instruction: Simulate the real lottery “MEGA MILLIONS” and create a good GUI. The rule of the game is (from Internet): “The Lottery game in which the ticket purchaser selects, or has the computer randomly assign five (5)” different “numbers from Field 1 which includes a range of consecutive numbers from one (1) to fifty-six (56) and one (1) number from Field 2 which includes a range of consecutive numbers from one (1) to forty-six (46), shall be called MEGA MILLIONS". For example, the winning numbers from Field 1 may be {03, 05, 10, 20, 43} and from Field 2 {05}. As you can see the number from Field 2 may be the same as one of the numbers of Field 1. You have different ways to develop your algorithm and code. One of the ways is to use ArrayList. You are free to select some other way. Please give UML diagrams for all classes.

This is what I already have

}

Explanation / Answer

Here is the Code for your lottery game: ----------------->>>>>>>>>>>>>>>>>>>>

import java.util.*;
import java.lang.*;


class Purchaser{
private String name;
private int age;
private String place;
private int lottery;
private int blottery;

Purchaser(){
  name = " ";
  age = 0;
  place = " ";
}
public void setName(String n){
  name = n;
}
public void setLottery(int a,int b){
  lottery = a;
  blottery = b;
}
public void setAge(int a){
  age = a;
}
public void setPlace(String p){
  place = p;
}
public String getName(){
  return name;
}
public String getPlace(){
  return place;
}
public int getAge(){
  return age;
}
}

class Lottery{
static int[] lottery = new int[5];
static int winningNo;
static int blottery;
public static void main(String[] args) {
  int age = 0;
  String name;
  String place;
  int lotteryNo;
  int blotteryNo;
  Purchaser p = new Purchaser();
  Scanner sc = new Scanner(System.in);

  System.out.println("-------------------------WELCOME TO LOTTERY-------------------");
  System.out.print(" Enter Your name : - ");
  name = sc.next();
  System.out.print(" Enter Your place : - ");
  place = sc.next();
  while(age < 18){
   System.out.print(" Enter Your age : - ");
   age = Integer.parseInt(sc.next());
  }
  p.setName(name);
  p.setPlace(place);
  p.setAge(age);

  winningNo = (int)(Math.random()%100)+1;
  blottery = (int)(Math.random()%100)+1;

  for(int i = 1;i<101;i++){
   System.out.println(" lottery"+i);
   if(winningNo == i){
    for(int j = 0; j<5;j++){
     lottery[j] = (int)(Math.random()*100)+1;
     System.out.print(" "+lottery[j]);
    }
   }
   else{
    for(int j = 0; j<5;j++){
     System.out.print(" "+((int)(Math.random()*100)+1));
    }

   }
  }
  System.out.println("Choose from above lottery no ");
  lotteryNo = Integer.parseInt(sc.next());

  for(int i = 1;i<101;i++){
              System.out.println("Bumber Lottery"+1);
              if(blottery == i){
              blottery = (int)(Math.random()*100)+1;
              System.out.println(" "+blottery);
              blottery = i;
              }
              else
              System.out.println(" "+((int)(Math.random()*100)+1));
  }
  System.out.println("Choose from above Bumper lottery no ");
  blotteryNo = Integer.parseInt(sc.next());

  p.setLottery(lotteryNo,blotteryNo);

  if(winningNo == lotteryNo || blotteryNo == blottery){
   System.out.println(" You Won The Lottery : ");
   System.out.println("Name : "+p.getName());
   System.out.println("Place : "+p.getPlace());
   System.out.println("Age : "+p.getAge());
  }
  else{
   System.out.println(" You Loose The Lottery : ");
  }

}

}