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
sveticcg [70]
3 years ago
10

Create a package named one_dimensional_array and write a class that completes the following "OneDimensionalArrays" class. You wi

ll complete the class by filling in code wherever you see the comment:
Engineering
1 answer:
yan [13]3 years ago
7 0

Answer:

The filled in codes are

1) private static int[] arr;

2)  int arr[] = new int[size_of_array];

        int increment = 100;

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

       arr[i] = increment * i;

       }

      return arr;

3) for (int i = 0; i < myArray.length; i++) {

      System.out.println(myArray[i]);

4)  OneDimensionalArrays result = new OneDimensionalArrays();

    result.createIntegers(num);

    result.printArray(arr);

Explanation:

Create a package named one_dimensional_array and write a class that completes the following "OneDimensionalArrays" class. You will complete the class by filling in code wherever you see the comment:

//******* FILL IN CODE *********

import java.util.Scanner;

public class OneDimensionalArrays {

   

   int[] createIntegers(int size_of_array)

   {

      //*******  FILL IN CODE *********

      // Your code will create an array of ints as large as specified in size_of_array

      // Fill the array in with the values: 0, 100, 200, 300, ....

      // Return the array that you just created

   }

   void printArray(int[] myArray)

   {

      //*******  FILL IN CODE *********

       // Print out your array with one number per line.  Get the size of the

       // array from the "myArray" parameter (no hard coding the size)

   }

   public static void main(String[] args) {

       Scanner keyboard = new Scanner(System.in);

       

       System.out.println("Enter size of array to create: ");

       int num = keyboard.nextInt();

       //*******  FILL IN CODE *********

       // Construct an instance of the OneDimensionalArrays class

       // Using this object instance, call createIntegers to create

       // an array of integers.  Don't forget to save the results

       // Then call the printArray method to print out the contents

       // of your array.

       }

}

Completed Code when filled in looks this way below:

import java.util.Scanner;

public class OneDimensionalArrays {

  private static int[] arr;

  int[] createIntegers(int size_of_array) {

       int arr[] = new int[size_of_array];

       int increment = 100;

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

             arr[i] = increment * i;    

       }

       return arr;

   }

   void printArray(int[] myArray) {

       for (int i = 0; i < myArray.length; i++) {

           System.out.println(myArray[i]);          

       }

   }

   public static void main(String[] args) {

       Scanner keyboard = new Scanner(System.in);

       System.out.println("Enter size of array to create: ");

       int num = keyboard.nextInt();

       OneDimensionalArrays result = new OneDimensionalArrays();

       result.createIntegers(num);

       result.printArray(arr);

   }

}

You might be interested in
Force = 33 newtons
kicyunya [14]

Answer:

answer

Explanation:

4 0
3 years ago
It is important to keeo a copy of your written plan and safety record s off-site. True or false
lyudmila [28]

Answer:

The answer for the question is true

Explanation:

If you get a virus or get hacked you will still have it saved

8 0
3 years ago
You work in a furniture store. You receive a
spin [16.1K]

Answer:

18 pieces of furniture

Explanation:

Since you receive $120.93 per furniture piece and a the month's commission is $2,176.74 you divide the commission by the furniture price.

  • 2176.74/120.93
3 0
3 years ago
Read 2 more answers
Brainstorming is the problem-solving method engineers use most.<br>True<br>False​
Lilit [14]

Answer:

I'm pretty sure it's false

Explanation:

Brainstorm is part of a problem-solving method. you can't solve a problem with nothing but brainstorming

7 0
3 years ago
A 0.40-m3 insulated piston-cylinder device initially contains 1.3 kg of air at 30°C. At this state, the piston is free to move.
Setler79 [48]

Answer:

(a) The Final Temperature is 315.25 K.

(b) The amount of mass that has entered  0.5742 Kg.

(c) The work done is 56.52 kJ.

(d) The entrophy generation is 0.0398 kJ/kgK.

Explanation:

Explanation is in the following attachments.

6 0
3 years ago
Other questions:
  • A construction manager is looking for workers to build a series of walkways within a large garden apartment. What type of workme
    12·1 answer
  • In normal operation, a paper mill generates excess steam at 20 bar and 400◦C. It is planned to use this steam as the feed to a t
    14·1 answer
  • A heat engine does 210 J of work per cycle while exhausting 440 J of waste heat. Part A What is the engine's thermal efficiency?
    6·1 answer
  • You are considering purchasing a compact washing machine, and you have the following information: The Energy Guide claims an est
    8·1 answer
  • The minimum fresh air requirement of a residential building is specified to be 0.35 air changes per hour (ASHRAE, Standard 62, 1
    10·1 answer
  • Sam constructs a circuit, connects a lead acid battery of 2 V to a lamp of resistance 3 Ω and places an ammeter across it. What
    8·2 answers
  • Two engineers are discussing the various merits of hydroelectricity. Engineer A says that tidal barrage systems can generate ele
    6·1 answer
  • A motor vehicle has a mass of 1200kg and the road wheels have a radius of 360mm. The engine rotating parts have a moment of iner
    5·1 answer
  • Our rule-of-thumb for presenting final results is to round to three significant digits or four if the first digit is a one. By t
    12·1 answer
  • Pointttttttttttttssssssssssss
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!