1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Lelu [443]
2 years ago
9

Describe the necessary Java commands to create a Java program for creating a lottery program using arrays and methods.

Computers and Technology
2 answers:
netineya [11]2 years ago
5 0
I think each lottery ticket will cost £5 each so you would count in 5s till you reach the amount of tickets to get the answer which is £25
wariber [46]2 years ago
5 0

Answer: would use the for loop in this java program. A for loop is a repetition control structure that allows you to write a loop that needs to be executed a specific number of times which is why it's beneficial for the lottery program. A for loop is useful when you know how many times a task is to be repeated. import java.util.Random;import java.util.Scanner;public class LotteryGame

{  public static void main(String[] args) {     // TODO Auto-generated method stub     

Random r = new Random();     
int random[] = new int[5];   

  for (int i = 0; i < 5; ++i) {   
     random[i] = r.nextInt(48) + 1;     } 

    Scanner


sc = new Scanner(System.in);    
 int usernumbers[] = new int[5];     

System.out.print("Enter 5 numbers: ");  

   for (int i = 0; i < 5; ++i) { 

  usernumbers[i] = sc.nextInt();     }     

System.out.print("\nRandom Numbers: ");    
 for (int i = 0; i < 5; ++i)        

System.out.print(random[i] + " ");  
   System.out.print("\nUser Entered Numbers: ");     for (int i = 0; i < 5; ++i)        

System.out.print(usernumbers[i] + " ");   

  int match = 0;    
 for (int i = 0; i < 5; ++i) {       
 for (int j = 0; j < 5; ++j) {          

 if (random[i] == usernumbers[j])              
++match;        }

     }     
System.out.println("\nThere are " + match + " number of matches");  }

Explanation:

You might be interested in
what should i do after learning python? how can I make apps or gaming apps? IF YOUR ANSWER WILL BE GOOD I WILL MARK AS BRAINLIES
seraphim [82]

Answer:

Here are some of the things that you can do after learning Python:

Learn a Web Development Framework

Learn Machine Learning

Start Teaching Python to Beginners (and earn some bucks)

These are the top three ways to proceed

Explanation:

8 0
3 years ago
Read 2 more answers
When an attacker attempts to gain access to a user's computer by stealing the encrypted file containing the password hash that w
-Dominant- [34]
Correct answer: Offline cracking

In cryptanalysis and computer security, password cracking is the process of recovering passwords from data that have been stored in or transmitted by a computer system. A common approach (brute-force attack) is to try guesses repeatedly for the password and check them against an available cryptographic hash of the password.

The purpose of password cracking might be to help a user recover a forgotten password (installing an entirely new password is less of a security risk, but it involves System Administration privileges), to gain unauthorized access to a system, or as a preventive measure by system administrators to check for easily crackable passwords. On a file-by-file basis, password cracking is utilized to gain access to digital evidence for which a judge has allowed access but the particular file's access is restricted.

5 0
4 years ago
When testing object-oriented software it is important to test each class operation separately as part of the unit testing proces
aalyn [17]
Umm I think it's B) false
8 0
3 years ago
The Mobile Agricultural Machinery and Equipment Coverage Form does not include coverage for:__________.
satela [25.4K]

Answer:

  • Aircraft, watercraft, their equipment or  parts; automobiles; dealers'  demonstration equipment, machinery and vehicles; dirt bikes, house trailers, mobile homes, mopeds, motorcycles, motorized bicycles or tricycles, snowmobiles, trucks, vehicles primarily designed and licensed for road  use (other than wagons and trailers designed for farming purposes and used principally on the insured location);
  • Barn cleaners, boilers, bulk feed tanks or  bins, bulk milk tanks, pasteurizers or any  permanent fixtures attached to or within a building; c. Cotton pickers, harvester-thresher combines and four-wheel all-terrain vehicles not specifically declared and described in the  Declarations with a Limit of Insurance for  each item;
  • Irrigation equipment; or
  • Contraband, or property in the course of  illegal transportation or trade.

Explanation:

  • Aircraft, watercraft, their equipment or  parts; automobiles; dealers'  demonstration equipment, machinery and vehicles; dirt bikes, house trailers, mobile homes, mopeds, motorcycles, motorized bicycles or tricycles, snowmobiles, trucks, vehicles primarily designed and licensed for road  use (other than wagons and trailers designed for farming purposes and used principally on the insured location);
  • Barn cleaners, boilers, bulk feed tanks or  bins, bulk milk tanks, pasteurizers or any  permanent fixtures attached to or within a building; c. Cotton pickers, harvester-thresher combines and four-wheel all-terrain vehicles not specifically declared and described in the  Declarations with a Limit of Insurance for  each item;
  • Irrigation equipment; or
  • Contraband, or property in the course of  illegal transportation or trade.

3 0
3 years ago
CSDL: S, P, SP hãy:
fomenos

Answer:

bvghhhhjbhjjhzzsjggjhgfeht275&+jxf ff jdffgfkhjjhgdgghfhkjjhhggkjhgf

Explanation:

Tên mặt hàng không có màu xanh

2. Mã của các mặt hàng được bán bởi nhà cung cấp có mã là 'S1'

3. Tên mặt hàng được bán bởi nhà cung cấp có mã là 'S1'

4. Tên mặt hàng được bán bởi nhà cung cấp có mã là 'S1' và có xuất xứ ở Hà Nội

5. Tên nhà cung cấp có bản mặt hàng mà có giá trong khoảng 50-100Tên mặt hàng không có màu xanh

2. Mã của các mặt hàng được bán bởi nhà cung cấp có mã là 'S1'

3. Tên mặt hàng được bán bởi nhà cung cấp có mã là 'S1'

4. Tên mặt hàng được bán bởi nhà cung cấp có mã là 'S1' và có xuất xứ ở Hà Nội

5. Tên nhà cung cấp có bản mặt hàng mà có giá trong khoảng 50-100Tên mặt hàng không có màu xanh

2. Mã của các mặt hàng được bán bởi nhà cung cấp có mã là 'S1'

3. Tên mặt hàng được bán bởi nhà cung cấp có mã là 'S1'

4. Tên mặt hàng được bán bởi nhà cung cấp có mã là 'S1' và có xuất xứ ở Hà Nội

5. Tên nhà cung cấp có bản mặt hàng mà có giá trong khoảng 50-100Tên mặt hàng không có màu xanh

2. Mã của các mặt hàng được bán bởi nhà cung cấp có mã là 'S1'

3. Tên mặt hàng được bán bởi nhà cung cấp có mã là 'S1'

4. Tên mặt hàng được bán bởi nhà cung cấp có mã là 'S1' và có xuất xứ ở Hà Nội

5. Tên nhà cung cấp có bản mặt hàng mà có giá trong khoảng 50-100Tên mặt hàng không có màu xanh

2. Mã của các mặt hàng được bán bởi nhà cung cấp có mã là 'S1'

3. Tên mặt hàng được bán bởi nhà cung cấp có mã là 'S1'

4. Tên mặt hàng được bán bởi nhà cung cấp có mã là 'S1' và có xuất xứ ở Hà Nội

5. Tên nhà cung cấp có bản mặt hàng mà có giá trong khoảng 50-100

5 0
3 years ago
Read 2 more answers
Other questions:
  • In 150 of your own words, please consider how you might use some of the Outlook skills you reviewed and practiced. Evaluate how
    6·1 answer
  • The _______ has shortcuts to commonly used commands.
    7·2 answers
  • The following are sources of secondary data except _________. a libraries b data bases c focus groups d syndicated research e sc
    10·1 answer
  • JavaScript uses which property to change the current content of HTML elements?
    6·1 answer
  • Does anyone know in adobe photoshop , digital design class , how to make a smart object and copy it to another page!
    6·1 answer
  • 19. Fair use applies to which of the following situations?
    14·1 answer
  • Consider the following class definition.
    7·1 answer
  • Which game would be classified as an advergame?
    6·2 answers
  • Which is the correct code to declare a catch-all handler?
    13·1 answer
  • How many 60 KB jpeg files can be stored on a 2 MB folder in your hard drive?​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!