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
Your school computer library has a network that connects computers and devices within a few small rooms. what type of network do
Pachacha [2.7K]
A routed and secured network which can send internet access to all computers 

3 0
3 years ago
having your online class there's a lot of hazards and risk you may encounter while using gadget PC or Laptop whar do you usually
Anastaziya [24]
Unsure that if your visiting a site, that it is a secure website or don't download anything unless you know for sure that it is safe
5 0
3 years ago
Estoy haciendo codificación en este momento es tan confuso y no estar en la escuela es más difícil
Katarina [22]

Answer:

Misma

Explanation:

6 0
3 years ago
Read 2 more answers
How has the Internet changed the design industry?
Alexandra [31]
<span>Loads of ‘easy to use’ programmes and ‘How To’ guides make it simple for anyone to put a brochure/newsletter/marketing piece together – how difficult can it be with so much help available? Technology has not only changed the way designs are accomplished, it’s changed the perception of ‘design’ from a hard earned skill to something you can learn in an afternoon off.

via </span>https://dmjcomputerservices.com/blog/technology-changed-design-industry/

4 0
3 years ago
What sound customization option would you use in Scratch to simulate a sound happening in a large, empty room (like a theater)?
denis23 [38]
C. Echo ( I May Be Wrong )
8 0
2 years ago
Other questions:
  • Jackie is planning a birthday party for her little brother and is researching different trampoline parks. She receives a pop-up
    12·2 answers
  • How are different types of cars similar and different?
    10·1 answer
  • To print data sideways on a piece of paper, use the _______ page orientation setting.
    6·2 answers
  • Match each type of software license with the appropriate definition.
    11·1 answer
  • Display the total number of parking tickets.
    5·1 answer
  • How did you generate a random number for the user to guess?
    9·1 answer
  • Help!!
    15·1 answer
  • Look at (c), is it accurate? ​
    9·2 answers
  • What are the characteristics of computer. Explain any one​
    15·2 answers
  • Which tab do you open to access the Comments feature?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!