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
Marshall's ruling in Marbury v. Madison is a testament to his strategic political skills for which of the following reasons? Sel
gladu [14]

Answer:

The following reason is letter D.

Explanation:

<em>Even though the real correct answer should be:  It did not immediately strenghten the Court's power in its relations with the President or Congress.</em>

6 0
4 years ago
Find the remaining trigonometric function of 0 if
amm1812

Answer:

Hope this will help you

have a great day

8 0
3 years ago
20. What is a "whipping motion and why is it<br> used?
Reptile [31]
Whipping is done in a forward direction. You deposit a dab or puddle of metal down, and then whip the rod forward and up a little to let that dab cool a bit, then you move back and deposit another dab slightly ahead of the previous dab.
Cellulose rod like 6010 and 6011 are known as "fast freeze" electrodes, also known to be deep penetrating rods. The "whip and stitch" motion is used so that you get the full benefit of the cellulose characteristics. The forward motion basically gouges out the base metal, and it gets filled in with the back-step.
Hope this helped:)
6 0
4 years ago
Neon is compressed from 100 kPa and 20◦C to 500 kPa in an isothermal compressor. Determine the change in the specific volume and
PIT_PIT [208]

Answer:

The specific volume is reduced in 80 per cent due to isothermal compression.

Specific enthalpy remains constant.

Explanation:

Let suppose that neon behaves ideally, the equation of state for ideal gases is:

P\cdot V = n\cdot R_{u}\cdot T

Where:

P - Pressure, measured in kilopascals.

V - Volume, measured in cubic meters.

n - Molar quantity, measured in kilomoles,

T - Temperature, measured in kelvins.

R_{u} - Ideal gas constant, measured in \frac{kPa\cdot m^{3}}{kmol\cdot K}.

On the other hand, the molar quantity (n) and specific volume (\nu), measured in cubic meter per kilogram, are defined as:

n = \frac{m}{M} and \nu = \frac{V}{m}

Where:

m - Mass of neon, measured in kilograms.

M - Molar mass of neon, measured in kilograms per kilomoles.

After replacing in the equation of state, the resulting expression is therefore simplified in term of specific volume:

P\cdot V = \frac{m}{M}\cdot R_{u}\cdot T

P\cdot \nu = \frac{R_{u}\cdot T}{M}

Since the neon is compressed isothermally, the following relation is constructed herein:

P_{1}\cdot \nu_{1} = P_{2}\cdot \nu_{2}

Where:

P_{1}, P_{2} - Initial and final pressure, measured in kilopascals.

\nu_{1}, \nu_{2} - Initial and final specific volume, measured in cubic meters per kilogram.

The change in specific volume is given by the following expression:

\frac{\nu_{2}}{\nu_{1}} = \frac{P_{1}}{P_{2}}

Given that P_{1} = 100\,kPa and P_{2} = 500\,kPa, the change in specific volume is:

\frac{\nu_{2}}{\nu_{1}} = \frac{100\,kPa}{500\,kPa}

\frac{\nu_{2}}{\nu_{1}} = \frac{1}{5}

The specific volume is reduced in 80 per cent due to isothermal compression.

Under the ideal gas supposition, specific enthalpy is only function of temperature, as neon experiments an isothermal process, temperature remains constant and, hence, there is no change in specific enthalpy.

Specific enthalpy remains constant.

8 0
3 years ago
Technician A says that TSBs are typically updates to the owner's manual. Technician B says that TSBs are generally
vichka [17]

Answer:

Technician A says that TSBs are typically updates to the owner's manual. Technician B says that TSBs are generally

updated information on model changes that do not affect the technician. Who is correct? the answer is c

4 0
3 years ago
Other questions:
  • WHAT IS THE BEST ADVICE FOR SENDING EMAILS? *
    5·1 answer
  • The electricity generated by wind turbines annually in kilowatt-hours per year is given in a file. The amount of electricity is
    5·2 answers
  • Suppose that on your 21st birthday you are given a $1,000,000 trust fund. If you can earn 4% in annual compound interest, how mu
    10·1 answer
  • Air at a pressure of 6000 N/m^2 and a temperature of 300C flows with a velocity of 10 m/sec over a flat plate of length 0.5 m. E
    7·1 answer
  • Water enters the tubes of a cold plate at 70°F with an average velocity of 40 ft/min and leaves at 105°F. The diameter of the tu
    8·1 answer
  • A driver counts 21 other vehicles using 3 EB lanes on one section of I-80 between her rented car and an overpass ahead. It turne
    14·1 answer
  • Every time I take a photo, that photo has to be stored in a file somewhere within "My Files" correct?
    15·2 answers
  • if stall speed in ktas for an aircraft us 100 ktas at sea level, what is the stall speed in ktas of the aircraft at 5000 ft dens
    7·1 answer
  • During delivery of a 2023 ariya equipped with propilot assist 2. 0, what should you point out to your customers about the turn s
    12·1 answer
  • joe is an exceptional systems engineer who hopes to work at the techtonic group. he is handicapped and uses a wheelchair. techto
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!