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
Write a c++ to read seven days in an array and print it
shepuryov [24]

Explanation:

Photosynthesis, the process by which green plants and certain other organisms transform light energy into chemical energy. During photosynthesis in green plants, light energy is captured and used to convert water, carbon dioxide, and minerals into oxygen and energy-rich organic compounds.

6 0
2 years ago
A collection of entries posted on a web site and displayed in reverse chronological order (from newest to oldest entries), is kn
Zina [86]
A) Social Collaboration

Social Collaboration is a way for people to combine their information and make it easier to go through and to work well as a team.
7 0
3 years ago
Static packet filtering firewalls are limited to ________. inspecting packets for which there are good application proxy filteri
inna [77]

Answer:

The answer to the following question is "inspecting packets in isolation from their context".

Explanation:

Static Packet Filtering a technique for implementing security of the firewalls. In this process, it checks each packet against a group of commands if commands allow the type of packet then it is passed otherwise, it is dropped. It controls access to a network by analyzing the sending and receiving packets based on the IP addresses of the source and destination.

7 0
3 years ago
What happens to the Menu Bar when the<br> object (image, shape, etc.) is "active"?
nexus9112 [7]

Answer: Ok so Sorry about this but I will answer thing at 10:20 tommorow I promise

Explanation:

5 0
2 years ago
You are comparing two properties for lease. The first, A, is all-inclusive at $4,000 per month. The second, B, is $2,300 per mon
Lemur [1.5K]
Take 4,000 times 12 to get 48,000. that’s how much A costs.

B is a little harder. you have to take (2,300+300)x12+(4*250). this equals $32,100

the correct answer would be B.
6 0
2 years ago
Other questions:
  • What is Gamekit Loa3's all questsions
    14·1 answer
  • A(n) ____________________ or cryptosystem is an encryption method or process encompassing the algorithm, key(s) or cryptovariabl
    11·1 answer
  • This measures how close a biometric reading is to a prerecorded template
    11·1 answer
  • How do I insert a row in between 1 and 2 in excel?
    7·2 answers
  • nside of your organization that checks how often client machines access it. If a client machine hasn't accessed the server in th
    6·1 answer
  • The computer system for a major retail store was hacked. Many addresses, credit card numbers, and other pieces of customers’ per
    7·2 answers
  • 75+ (43-54)<br> -12<br> 12<br> 41
    12·2 answers
  • Which of the following is NOT a type of insurance fraud?
    14·2 answers
  • Write a function that accepts a positive random number as a parameter and returns the sum of the random number's digits. Write a
    10·1 answer
  • How does the computer help me with school work
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!