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
How could increasing the budget for testing have prevented the problem experienced by the mars orbiter?
vlada-n [284]

Answer:

this might help

Explanation:

https://science.ksc.nasa.gov/mars/msp98/misc/MCO_MIB_Report.pdf

5 0
3 years ago
Conduction is thermal energy transfer by:_______.
adell [148]

Answer:

a. molecular interactions.

Explanation:

Conduction is thermal energy transfer by molecular interactions. Therefore, conduction involves the transfer of electric charge or thermal energy due to the movement of particles. When the conduction relates to electric charge, it is known as electrical conduction while when it relates to thermal energy, it is known as heat conduction.

In the process of heat conduction, thermal energy is usually transferred from fast moving particles to slow moving particles during the collision of these particles. Also, thermal energy is typically transferred between objects that has different degrees of temperature and materials (particles) that are directly in contact with each other but differ in their ability to accept or give up electrons.

Some examples of conductors include metal, steel, aluminum, copper, graphite, etc.

Hence, conduction is thermal energy transfer as a result of the movement of electrons and collision between the molecules of an object.

5 0
3 years ago
Explain orthographic<br>and multi-view<br>projection​
Elina [12.6K]

Answer:

Orthographic projection is a projection method to present three-dimensional shapes in two-dimensional format in which the projection lines are drawn to be orthogonal to the plane of projection, such that each view of the three-dimensional object is translated to a view of the orthographic projection and orthogonal to the view

A multiview projection is the representation of a three-dimensional projection by two or more two-dimensional views

Explanation:

3 0
4 years ago
A safety interlock module operates by monitoring the voltage from the
In-s [12.5K]

Answer: its an Ignition coil

8 0
4 years ago
Which of the following are true about the American Wire Gauge?
harina [27]

Answer:

A. smallest wire is No. 12

7 0
3 years ago
Other questions:
  • A stress researcher wants to look at the effect of meditation on anxiety. To do this, she creates two groups of subjects: one gr
    13·1 answer
  • A metal plate of 400 mm in length, 200mm in width and 30 mm in depth is to be machined by orthogonal cutting using a tool of wid
    12·2 answers
  • If you are a government authority what extend will you modify the existing policy
    11·1 answer
  • The function below takes a two parameters: a list called a_list and a value called a_value. Complete the function to first check
    11·1 answer
  • Consider airflow over a plate surface maintained at a temperature of 220°C. The temperature profile of the airflow is given as f
    6·1 answer
  • What are the desired characteristics or values for the following parameters of an ideal amplifier?o Phase change as a function o
    10·1 answer
  • Mining is an example of this type of business
    7·1 answer
  • I don’t know the answer to this question
    9·2 answers
  • Deidre has just moved from the sales department into the finance department. On her first day in her new role, she receives an e
    14·1 answer
  • Which of the following is a correct version of a user story?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!