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
Based on​ Sam's description of an information​ system, all of the following are components of an IS except​ _____.
svetoff [14.1K]

Answer:

the answer is A

Explanation:

My smartness

5 0
3 years ago
Explain why the fundamental software engineering principles of process, dependability, requirements management, and reuse are re
Georgia [21]

These principles are not explicit to one kind of program and are increasingly broad "best practice" rules that assist designers with composing code that is easier to maintain.

<u>Explanation:</u>

A set of programming guidelines that are executed to play out a particular undertaking according to the prerequisites of the client is known as programming. Every product has some essential standards to follow. In light of all product frameworks have basic quality traits, including accessibility, modifiability, execution, security and wellbeing, testability and ease of use, the key programming thoughts give basic arrangements or strategies to help those characteristics.

It is generally less expensive, over the long haul, to utilize programming designing strategies and methods for programming frameworks instead of simply compose the projects as though it was an individual programming venture.

8 0
3 years ago
. _______ view focuses on the text and content of a document, without much information on the page layout.
Georgia [21]
Read view
It allows to hide all instrument panels
5 0
3 years ago
Using Module operator, write a java program to print odd number between 0 and 1000​
jolli1 [7]

Answer:

class OddNumber

{

  public static void main(String args[])  

       {

         int n = 1000;  //Store 1000 in Variable n typed integer

         System.out.print("Odd Numbers from 1 to 1000 are:");  // Print headline of output window

         for (int i = 1; i <= n; i++)  //For loop to go through each number till end

          {

            if (i % 2 != 0)  //check if number is even or odd.Not divisible by 2 without reminder means it is odd number

             {

               System.out.print(i + " "); //print odd numbers

             }

          }

       }

}              

5 0
3 years ago
.............. 1010111 needs to be transferred w.ith odd parity and the answer is
notsponge [240]

Answer:

A. 01010111

Explanation:

This is because in odd parity, the number on the far left (the 8th number) would always be a 0

7 0
3 years ago
Read 2 more answers
Other questions:
  • In your presentation you added a text box to?
    5·1 answer
  • Different between ocular and compound miscroscope
    13·1 answer
  • Which of the following terms best describes the security domain that relates to how data is classified and valued?
    14·1 answer
  • Convert each of the following base 10 &amp; base 2 numbers in signed magnitude, one’s complement and two’s complement. Each of t
    8·1 answer
  • Why do bats sleep upside down
    7·1 answer
  • You should always assign the Needs Met rating before assigning the Page Quality rating, T or F ?
    6·2 answers
  • If you have defined a class named SavingsAccount with a public static data member named numberOfAccounts, and created a SavingsA
    7·1 answer
  • Free points,
    15·2 answers
  • How does this happen on brianly???
    5·2 answers
  • question 1 scenario 1, question 1-5 you’ve just started a new job as a data analyst. you’re working for a midsized pharmacy chai
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!