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
The assignment symbol can be combined with the arithmetic and concatenation operators to provide augmented assignment operations
uranmaximum [27]

Answer:

Yes, we can.

Explanation:

We can combine with the arithmetic and the concatenation operators to provide augmented assignment operations in the programming language Python.

This mean we can abbreviate expressions like n = n + 1

For example:

n += 10 this is equal to n = n + 10

n += "example" this is equal to n = n + "example"

In this example we have

variable = variable operator expression equal to variable operator = expression.

These arguments are often used in Python's loops.

3 0
3 years ago
A polyalphabetic cipher uses many ___
Greeley [361]

Answer:d) Mono-alphabetic substitution rules

Explanation: Poly-alphabetic cipher is the cryptography that is done by using the many alphabets in substitutional way. They are supposed to have a good security because they use cipher text alphabets for the encryption and then decrypts it.

Substitution of the alphabets is done by the rule of the mono-alphabetic substitution rules.Other given options are incorrect because they are not used in the cryptography of the alphabetic cipher. Thus option (d) is the correct answer.

3 0
3 years ago
You are building a computer from spare parts in the office. You build the computer and realize you have several different types
san4es73 [151]

Answer:

The pin count is the same

Explanation:

5 0
3 years ago
Which devices are most likely to communicate with the internet? Select 3 options.
Anon25 [30]
<h2>Answer:</h2>

<h3>smart phone </h3>

<h3>cars </h3>

<h3>delivery trucks</h3>
5 0
3 years ago
The initial step of the five-step problem-solving model is to: A. Explore alternatives B. Clarify values. C. Develop an approach
Alik [6]

Answer:

D. Identify the problem.

Explanation:

         

The five steps are -

  • Identify the problem
  • Understanding the problem
  • Select any alternative way to solve a problem
  • Select the best way to solve a problem from the list of alternative solutions.
  • List the instructions to solve the problem using the selected solution and evaluate the solution .

Identify the problem - This is the first steps towards solving a given problem. One must properly comprehend what exactly the challenge is.

8 0
3 years ago
Other questions:
  • Can someone fix this so that it only says "its a payday" on 15 and 30 and on all other days "sorry, it's not payday"
    9·1 answer
  • Carol typed a memo to send to everyone in her department. To create this memo, she used a _____. spreadsheet word processor fax
    10·2 answers
  • Your company shares a building with a competitor’s branch office. Recently, you noticed that some computers other than company c
    7·1 answer
  • HIPAA requires the following controls for medical records: A. Encryption of all data B. Technical safeguards C. Physical control
    12·1 answer
  • What are the two types of formulas in excel
    9·1 answer
  • Write an application that determines which, if any, of the following files are stored in the folder where you have saved the exe
    10·1 answer
  • What does 69 mean?<br> Whenever I watch memes they always talk about the number 69
    8·2 answers
  • Inserting and deleting text is a basic editing task in word processing.<br><br> True or false
    6·2 answers
  • What is the difference between posting and transfer in ICT please I need the answer before TMR​
    9·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!