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
are designed to locate information based on the nature and meaning of Web content, not simple keyword matches Select one: a. Cra
san4es73 [151]

Answer: C. Semantic Search Engines

Explanation:

Semantic search is simply search with meaning. It is designed to locate information based on the nature and meaning of Web content, not simple keyword matches (like in lexical searches)

4 0
3 years ago
How to be fluent in computer
Setler79 [48]

Explanation:

1. Seeing people do technological innovations, so you have some motivation and inspiration to be fluent in computer

2. Try experimenting and trying stuff, like trying to learn how to code, how the internet work, etc.

3. work more with computers, for example, make a note with OneNote, making digital art with blender, adobe illustrator etc.

4. Try to learn how to be better at learning computer, like, if you do mistakes in your learning journey, try to avoid it next time

5. good luck ;)

7 0
2 years ago
Read 2 more answers
Type of file containing instructions that tell your computer how to perform ___
julsineya [31]

Answer:

A)File

B)Native

C)Extension

D)File size

Explanation:

6 0
3 years ago
What is better in everybodys opinion. AMD or Intel?
Rama09 [41]

Answer:

Intel is more for work and such, while AMD is foucsed on gamers. I use AMD because I play many games, but it really depends on what you use your computer for.

Explanation:

4 0
3 years ago
Read 2 more answers
By what decade were books readily available to the public across the United States and Europe? A. 1690 B. 1750 C. 1860 D. 1820
sladkih [1.3K]

Answer: 1820

Explanation:

I <u>believe</u> the answer is the 1820, as the introduction of steam powered printing presses and steam powered paper mills significantly lowered the cost of books to decrease and significantly increased their circulation/availability.

hope this  helps

-lvr

6 0
3 years ago
Other questions:
  • Okay so remember that page I was advertising? At: fol ? Now it's deleted. And idk why because I was doing everything the right w
    7·1 answer
  • Forensic computer investigators must _____.
    6·2 answers
  • Print either "Fruit", "Drink", or "Unknown" (followed by a newline) depending on the value of userItem. Print "Unknown" (followe
    13·1 answer
  • The _____ function is a logical function that returns a TRUE value if any of the logical conditions are true and a FALSE value i
    10·1 answer
  • You are asked to monitor a network which has a network monitoring system. Using the monitoring server, you notice that it is lis
    13·1 answer
  • 3.3 Code Practice: Question 1
    15·1 answer
  • Describe two types of storage devices?​
    15·1 answer
  • High level language - An object oriented programming language​
    5·1 answer
  • Which type of protocol allows for a secure data transmission using encryption methods?
    7·1 answer
  • Differentiate between perfect and imperfect market​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!