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
elena-14-01-66 [18.8K]
3 years ago
11

Please help with coding assignment.

Computers and Technology
1 answer:
Inessa05 [86]3 years ago
4 0

Answer:

import java.util.Random;

class Main {

   

   public int stopAtFive (int j) {

      Random rand = new Random();

      int number = 0;

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

          number = rand.nextInt(9)+1;

          System.out.println(number);

          if (number == 5) {

              System.out.println();

              break;

          }

      }

      return number;

   }

   

   public static void main(String args[]) {

       Main main = new Main();

       main.stopAtFive(20);

       main.stopAtFive(20);

   }

}

Explanation:

Your requirements do not say what has to be displayed or returned from the method, but you can use this as a starting point.

You might be interested in
What's a qat on a computer
suter [353]
The answer is ..........

The Microsoft Quick Access Toolbar (QAT<span>) is a toolbar menu that appears in Microsoft Excel, Microsoft Word, and other Office 2007 and above products in the top left corner of the window. As seen in the picture, the Quick Access Toolbar gives you quick access to commonly used features such as the Save feature.
</span>
hope it helps have a great one! :)
5 0
3 years ago
Read 2 more answers
Which invention replaced vacuum tubes in computers?
dlinn [17]

Answer:

Transistors

Explanation:

6 0
2 years ago
Which commas is used to combine two or more cells together into one cell
AURORKA [14]
The command is Merge & Center
This command could be easily found in the toolbar of your excel.
If you execute this command in two different cells, those cells will be merged into one larger cell and the content in that cells will be placed exactly in the middle of the combined cell (measures according to combined cells' length)
5 0
3 years ago
An online survey is an effective way for an administrative professional to gather information. True False
Strike441 [17]

Answer:

True is the correct answer for the above question.

Explanation:

  • An online survey is done with the help of social sites that connects many people in conversation from all over the world. So to do an effective survey, it is best to choose the online medium.
  • The administrative professional is a professional, who works to do administrative tasks like managing the organization.
  • The above question-statement says that the online survey is the best survey, which is the correct statement, which is described above. Hence the answer is true for the above question.
7 0
3 years ago
A film producer is having difficulty with distribution. After major and minor theaters show no interest in the film, what would
irinina [24]

Answer:

pursue internet distribution

Explanation:

4 0
3 years ago
Other questions:
  • For an IP or device that is in the local network, it's a very straight forward cache table lookup for its MAC address. How does
    5·1 answer
  • Select all of the uses of presentation software in the workplace.
    8·1 answer
  • Design a method for representing the state of a tic-tac-toe board in computer memory. can you fit your representation into three
    12·2 answers
  • What is your favorite food
    11·2 answers
  • Strobe lights can become more yellow as they age true or false
    8·1 answer
  • Activity
    7·1 answer
  • Who here would like to play among us with me? <br> Time: Friday, November 13
    14·1 answer
  • PLZ HELP! ANSWER (WITH CORRECT ANSWER AND EXPLANATION THAT ACTUALLY IS CORRECT) GETS BRAINLIEST!
    13·1 answer
  • What is a cookie? *
    9·2 answers
  • Data mining requires specialized data analysts to ask ad hoc questions and obtain answers quickly from the system. select one: t
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!