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
What part connect to the tie rod that helps the brake chamber out that deals with slack adjuster
scoray [572]

Answer:

none

Explanation:

7 0
2 years ago
Who ate cdonalds in hell with god then died from food ppoisoning
siniylev [52]

Answer:

McDonald’s announced recently that they are going through some major menu changes, and will be nixing some unnecessary ingredients. They also are finally listening to us, and will stop using chickens that are injected with growth-promoting antibiotics, along with dairy products raised with the growth hormone rbST but they still are using a lot of factory farmed meat and the beef is still raised with antibiotics.

McDonald’s even said they might add kale to their menu, by putting it in salads or in a smoothie. I LOVE kale, and I hope they don’t find a way to ruin it. You know the saying, “You can put lipstick on a pig, but it’s still a pig”. So, they need to do a lot more than just add kale to their menu before I’d ever eat there. The problem is that millions are still eating there and consuming several questionable food additives that McDonald’s could remove entirely if they really wanted to.

Explanation:

7 0
3 years ago
Gn bbys sleep well<br><br><br><br><br> gn
Musya8 [376]

Answer:

mwuah

Explanation:

I got u girl, what r u on?

7 0
3 years ago
Read 2 more answers
Brainly is pretty boring
sdas [7]
That’s cool lol ????
8 0
3 years ago
Read 2 more answers
If the atomic radius of copper is 0.128 nm, calculate the volume of its unit cell in cubic meters.
Alex_Xolod [135]

Answer:

Volume of face centered cubic cell=4.74531*10^{-29} m^3

Explanation:

Consider the face centered cubic cell:

1 atom at each corner of cube.

1 atom at center of each face.

Consider the one face (ABCD) as shown in attachment for calculation:

Length of the all sides of face centered cubic cell is L.

Volume of face centered cubic cell= L^3

Now Consider the figure shown in attachment:

According to Pythagoras theorem on ΔADC.

L^{2}+L^2=(4a)^2     (a is the atomic radius)

L=\frac{4a}{\sqrt{2}} (Put in the formula of Volume)

Volume of face centered cubic cell= L^3

Volume of face centered cubic cell= (\frac{4a}{\sqrt{2}})^3

Volume of face centered cubic cell= (\frac{4(0.128*10^{-9}}{\sqrt{2}})^3

Volume of face centered cubic cell=4.74531*10^{-29} m^3

3 0
4 years ago
Other questions:
  • Decide whether or not the Final Value Theorem is applicable to the following functions. If not, indicate why you cannot apply it
    11·1 answer
  • What are the x and y coordinates of the centroid of the area?
    10·1 answer
  • A 3 ft x 2 ft block moves down a 15 degree inclined slope at a speed of V = 0.2 ft/s over a thin layer (h = 0.0125 ft) of oil wi
    13·1 answer
  • A resistor is made out of a long wire having a length L. Each end of the wire is attached to a terminal of a battery providing a
    10·1 answer
  • Training is a way for employers to provide ____ to enable employees to protect themselves and others from injuries.
    9·2 answers
  • How much wood could a wood chuck chuk if a wood chuck could chuck wood
    10·2 answers
  • Which of the following helps to ensure a centered steering wheel when performing a wheel alignment?
    10·1 answer
  • Is the science of measurement
    6·1 answer
  • What truck you like the best
    9·2 answers
  • Engineers design products or processes to meet desired needs. Your desired need or goal (hopefully) is to graduate with your Bac
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!