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
Which option should the engineers focus on as they develop the train in the following scenario?
pav-90 [236]

Answer:

  Engineers can design a train with a regenerative braking system

Explanation:

Assuming the point of the question is that the engineers want to focus on using energy efficiently when starting and stopping, they would likely want to consider a regenerative braking system. Such a system can store energy during braking so that it can be used during starting, reducing the amount of energy that must be supplied by an outside power source.

5 0
3 years ago
Many households in developing countries prepare food over indoor cook stoves with no ducting system to exhaust the combustion pr
lorasvet [3.4K]

Answer:

   C = 0.22857 ng / m³

Explanation:

Let's solve this problem for part the total time in the kitchen is

          t = 2h (60 min / 1h) = 120 min

The concentration (C) quantity of benzol pyrene is the initial quantity plus the quantity generated per area minus the quantity eliminated by the air flow. The amount removed can be calculated assuming that an amount of extra air that must be filled with the pollutant

amount generated

         C = co + time_generation rate / (area_house + area_flow)

         C = 0.2 + 0.01 120 / (40+ 2)

         C = 0.22857 ng / m³

7 0
3 years ago
Which of the following tools might civil engineers use when designing roads in a recently constructed industrial park?
Dmitry [639]

Answer:D. Gunter's Chain

Explanation:I know this because a gunter's chain is used for plots of land to be accurately surveyed and plotted, for legal and commercial purposes.

6 0
4 years ago
Read 2 more answers
How do you take a picture
Mrrafil [7]
to take a picture just choose “take photo” on the button next to the keypad, if you are on a computer it’s the same thing if your computer has a video screener or whatever they call it but if not I’m not sure, hope this helps!
7 0
3 years ago
Read 2 more answers
A rigid, well-insulated tank of volume 0.9 m is initially evacuated. At time t = 0, air from the surroundings at 1 bar, 27°C beg
Eva8 [605]

Answer:

\dot{w}= -0.303 KW

Explanation:

This is the case of unsteady flow process because properties are changing with time.

From first law of thermodynamics for unsteady flow process

\dfrac{dU}{dt}=\dot{m_i}h_i+\dot{Q}-\dot{m_e}h_i+\dot{w}

Given that tank is insulated so\dot{Q}=0 and no mass is leaving so

\dot{m_e}=0

\int dU=\int \dot{m_i}h_i\ dt-\int \dot{w}\ dt

m_2u_2-m_1u_1=(m_2-m_1)h_i- \dot{w}\Delta t

Mass conservation m_2-m_1=m_e-m_i

m_1,m_2 is the initial and final mass in the system respectively.

Initially tank is evacuated so m_1=0

We know that for air u=C_vT ,h=C_p T,P_2v_2=m_2RT_2

m_2=0.42 kg

So now putting values

0.42 \times 0.71 \times 730=0.42\times 1.005\times 300- \dot{w} \times 300

\dot{w}= -0.303 KW

3 0
3 years ago
Other questions:
  • Coal fire burning at 1100 k delivers heat energy to a reservoir at 500 k. Find maximum efficiency.
    6·1 answer
  • What is temperature coefficient of resistance
    12·1 answer
  • You live on a street that runs East to West. You just had 2 inche of snow and you live on the North side of the street. You retu
    14·1 answer
  • A converging - diverging frictionless nozzle is used to accelerate an airstream emanating from a large chamber. The nozzle has a
    15·2 answers
  • A spacecraft is fueled using hydrazine ​(N2H4​; molecular weight of 32 grams per mole​ [g/mol]) and carries 1 comma 630 kilogram
    12·1 answer
  • Ok I need a new laptop but I'm not sure which one. The Surface laptop 3 is better in many fields like the camera, speaker, audio
    14·1 answer
  • Consider a potato being baked in an oven that is maintained at a constant temperature. the temperature of the potato is observed
    14·1 answer
  • List five things the welding symbol will tell the welder about the weld that is to be made.​
    13·1 answer
  • Explain why veracity, value, and visualization can also be said to apply to relational databases as well as Big Data.
    6·1 answer
  • Precast concrete curtain wall panels: Group of answer choices are typically manufactured on site and then hoisted into place. of
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!