it's java programming?

timer Asked: Mar 29th, 2019
account_balance_wallet $40

Question Description

Write a Java Program to Play your version of the Texas Pick 3 Lottery. You will need to include the provided code given below in your program.

We will use 1 number as 000-999 instead of 3 separate values.

  1. In the main() method, declare an int named myPick3choice.
  2. Create a prompt for myPick3 as "Enter your Pick 3 choice:0-999".
  3. Create a method named playPick3 that has an int parameter named myPick3.
  4. In the playPick3 method, do the following:
    1. Create an int variable called playCounter and initialize it to 0.
    2. Create an int variable called myPick3Result.
      1. If myPick3Result matches the variable myPick3, then display the result of playcounter as "PlayCounter = ...." and exit the loop.
      2. If myPick3Resultdoes not match, increment the variable playCounter and continue the loop.
    3. Create a loop that calls the method officialPlayPick3 (Provided below) and store the result in myPick3Result.

5 points Extra Credit.

Create a loop in the main method to allow you to play as often as you wish.

Enter your Pick 3 choice 0-999: 554

PlayCounter = 1343 ( This result will vary )

Include the code below in your program. The code also requires the following import line:

import java.util.concurrent.ThreadLocalRandom;

* officialPlayPick3()
* Returns a random number 0-999
* @return int

public static int officialPlayPick3() {

final int min = 0;
final int max = 999;
return ThreadLocalRandom.current().nextInt(min, max + 1);


Tutor Answer

School: Purdue University

Hello buddy! Have already finished. Have sent two files, one zip and another with explanation in word form. Unzip the zipped file or you copy the code from the word. If you will have any question feel free to ask or any revision. I will be glad to see you back or recommend.

package Texaspick3;
import static Texaspick3.MyPick3.officialPlayPick3;
import static Texaspick3.texas2.officialPlayPick3;
import java.util.*;
import java.util.concurrent.ThreadLocalRandom;
public class texas2 {
static int myPick3Result;
public static void main(String[] args) {
int myPickChoice;//In the main() method, declare an int named myPick3choice.
System.out.println("Enter your Pick 3 choice:0-999");//...

flag Report DMCA

Tutor went the extra mile to help me with this essay. Citations were a bit shaky but I appreciated how well he handled APA styles and how ok he was to change them even though I didnt specify. Got a B+ which is believable and acceptable.

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors