Lottery requires that you select six different numbers

Assignment Help Computer Engineering
Reference no: EM1328405

The Lottery Problem:
A lottery requires that you select six different numbers from the integers 1 to 49. Write a Java program that will do this for you and generate five sets of six numbers as a result.

For generating random numbers you can use the random() static method of class Math. It returns a double so you will need to cast it as an integer. If you set the range to 49, you can generate a random number between 1 and 49 through:
number = (int) ( range * Math.random() ) + 1;
Note that you need 5 sets of numbers and in each set you have should have six different numbers. There should not be duplicate numbers within each set. Of course the same number can occur in multiple sets, but within the same set of 6 numbers it should only occur once, if at all.
Here is an example of a valid set of numbers: 5, 41, 3, 9, 22, 30
Here is an example of an invalid set of numbers: 15, 8, 19, 33, 8, 21
It is invalid because the number 8 appears twice.

Reference no: EM1328405

Questions Cloud

Elucidate the excess of cost over the marginal price : Elucidate the excess of cost over the marginal price at the profit maximizing price-quantity combination?
Top strategic considerations when developing media schedule : If you were a media planner for a large Fortune 500 company (your choice) what would be your top three strategic considerations when developing a media schedule?
Describe line process vs. batch process : Line Process vs. Batch Process - Effect on Functions - What concerns might the following functions have about this proposed change?
Question on retirement planning : The following retirement problem is often used to illustrate Significant aspects of savings and compound interest - see what you can learn by working the problem.
Lottery requires that you select six different numbers : A lottery needs that you select six different numbers from the integers 1 to 49. Write a Java program that will do this for you and generate five sets of six numbers as a result.
Management strategies to employ in current position : What management strategies can you employ in your current position (even if you are not yet a manager)?
Prepare a systems development plan : Create a systems development plan/efficient use of data - What lessons can be learned from creating a systems development plan and how can it help you contribute to current or future workplace settings?
As customers will more price sensitive also price conscious : Do you think we, as customers will be more price sensitive also price conscious. What do you think this means for luxury goods.
Explaining the objective theory of contracts : You are still working for the City of Bigtown's Counsel, and it seems that your work largely involves shooting down the mayor's "creative" ideas to boost tourism.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Implementing the code

Write down a program which utilizes a structure named MovieData in order to store the following information about the movieInvolve a constructor which allows all four of these member data values to be specified at the time a MovieData variable is g..

  Diffe-hellman algorithm

Alice and Bob use the Diffe-Hellman to agree on a secret key. They select the prime p = 11, and a primitive root mod 11 g = 2.

  Ethical policy that could be used by a team

Write down a short ethical policy that could be used by a team of IT workers when they encounter spam, email viruses or wish to use the company's denial-of-service rights.

  Predicate color and action paint using situation calculus

Predicate color and action paint using situation calculus

  Solve the problem using python programming

Solve the problem using PYTHON Programming

  Developing an object-oriented model for bookstore

The bookstore wishes you to develop an object-oriented model for the new bookstore information management system.

  Similarities and differences to issue of regulation

Describe the relevance of each of these similarities and differences in order to issue of regulation of the Internet.

  How to developing an information management framework

List and describe the steps involved in developing an Information Management framework.

  What is an interface

What is an interface

  Utilizing the rsa protocol encrypt and decrypt messages

You are asked to hand-turn the RSA protocol in order to encrypt and decrypt the messages (utilizing smaller numbers than are used in the practice, so that calculations may be done through the hand).

  Spreadsheet model of the heat transfer situation

Spreadsheet model of the heat transfer situation

  What security measures required to address vulnerabilities

What security measures required to address vulnerabilities Illustrate threats and vulnerabilities that are possible after implementing "big data" technologies in online auctioning company.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd