# Exercise 2 Write a program that simulates the Texas Powerball lottery. You will have to do resear...

###### Question:

I HAVE A PROBLE WITH THIS JAVA PROBLEM CAN ANYONE HELP ME PLEASE.

Exercise 2 Write a program that simulates the Texas Powerball lottery. You will have to do research to find out how many numbers are drawn, and what the range(s) of the numbers are. For this exercise you need to create a class called "Powerbali", which exposes a public function called play'. This function accepts several parameters , which represent the individual numbers the player wants to play. The function on the object should generate the correct amount of random numbers within the correct range(s), and compare the passed numbers to the drawing. This function should return a String that either tells the user that they unfortunately didn't win (if none of the user's numbers match the drawn numbers), or it tells the user the amount of correct numbers that were guessed, and which numbers were guessed correctly, e.g. "Congratulations, you guessed 3 numbers correct l, 2, 3” The class Powerball should overload the function play with one extra boolean parameter, which if passed as true, performs the number drawing over and over, until there occurs a drawing in which all the player's numbers match the randomly generated numbers. This function should return a String that says how many times a drawing was necessary to match the user's numbers Hint: this loop can potentially run for a very long time, and if you're unlucky, never produce a winner. Do not count on this loop to end, so you will have to be extra careful when implementing it, because testing it is not going to be trivial.

#### Similar Solved Questions

##### 10. In the conversion of phenylalanine into phenylpyruvic acid (shown below), what is the co-factor that is utilized to make the functional enzyme that carries out this oxidative deamination transfor...
10. In the conversion of phenylalanine into phenylpyruvic acid (shown below), what is the co-factor that is utilized to make the functional enzyme that carries out this oxidative deamination transformation? CO-H S-phenylalanine A. PLP (pyridoxal monophosphate) B. PMP (pyridoxamine monophosphate) C. ...
##### PART A&B (16%) Problem 5: A point charge of 4.8 pC is placed at the origin...
PART A&B (16%) Problem 5: A point charge of 4.8 pC is placed at the origin (x,-0) of a coordinate system, and another charge of-2.8 pC is placed placed on the x-axis at x2 = 0.27 m 50% Part (a) Where on the x-axis can a third charge be placed in meters so that the net force on it is zero? Grade ...
##### How to know when is favorable and unfavorable in a flex budget income statement? ( for...
how to know when is favorable and unfavorable in a flex budget income statement? ( for question VI) Using the base information in IV. show a flex budget income stam inventory) for next year in variable costing format based on unit Assume price will increase to 553 per unit. All other costs with ...
##### As current and future managers, you must be continually aware of how motivated your employees are....
As current and future managers, you must be continually aware of how motivated your employees are. We know that company culture, effective leadership, and social dynamics in the workplace are crucial to keeping your employees motivated. This chapter adds another potential dynamic to motivating your ...
##### Infection control. Professional Nursing 1. From Hebden, J. (2012). Rationale for accuracy and consistency in applying...
Infection control. Professional Nursing 1. From Hebden, J. (2012). Rationale for accuracy and consistency in applying standardized definitions for surveillance of health care-associated infections. American Journal of Infection Control 40(2012). Accessed from http://www.ajicjournal.org/pb/assets/raw...
##### A service provider measures availability over a month by dividing it into 10-minute intervals and performing...
A service provider measures availability over a month by dividing it into 10-minute intervals and performing a synthetic transaction testevery interval.  If the synthetic transaction test fails, the system is considered "down" for the entire 10 minute interval.  Scheduled...
##### Gino's Restaurant is a popular restaurant in Boston, Massachusetts. The owner of the restaurant has been...
Gino's Restaurant is a popular restaurant in Boston, Massachusetts. The owner of the restaurant has been trying to better understand costs at the restaurant and has hired a student intern to conduct an activity- based costing study. The intern, in consultation with the owner, identified the foll...
##### Use at least 3 sig fig. I will rate This projectile is launched on a 3-4-5...
use at least 3 sig fig. I will rate This projectile is launched on a 3-4-5 slope with an initial velocity v. of 100 feet per second at strikes a wall that is a distance d = 200 feet from the launch point. Find the height h at which the projectile strikes the wall. Report your answer in ft. hmax...
##### Why the traditional vew of factor price equalization (e.g., Chinas's workers get richer, US workers get...
why the traditional vew of factor price equalization (e.g., Chinas's workers get richer, US workers get poorer until average wages are equalized) is wrong...
##### 54. In what federal election cycles did more black voters first start to align themselves with the Democrats (which...
54. In what federal election cycles did more black voters first start to align themselves with the Democrats (which had been the party of the white South) rather than with Lincoln's Republican Party? a. By the 1936 election (FDR) b. By the 1940 election (FDR) c. By the 1944 election (FDR) d. All...
##### Please explain it. The angle θ is the angle of depression from E to T. This...
Please explain it. The angle θ is the angle of depression from E to T. This is the angle Al-Biruni measured as 0°34. (This is where you can see the picture is not to scale, as it would be a tiny angle.) The purpose of Al-Biruni's measurements was to find the radius and the circumferenc...
##### I need help writing my introduction to this lab, what is the purpose of this lab...
I need help writing my introduction to this lab, what is the purpose of this lab ? Extra Credit Reverberation Time Theory Reverberation is the combined effect of multiple sound reflections in a room that results in a gradual decay of the sound heard by the listener after the source of sound stops...
##### 40) Do you think it is important for an employer to provide innovative or unique benefits?...
40) Do you think it is important for an employer to provide innovative or unique benefits? Why or Why not? 5 points Your answer 41) What should happen when a manager and an employee can not agree 5 points on performance goals? Your answer 5 points 42) What are some creative, and low cost/ no cost wa...