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]
2 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]2 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
A strain gage is mounted at an angle of 30° with respect to the longitudinal axis of the cylindrical pressure. The pressure vess
GuDViN [60]

Answer:

1790 μrad.

Explanation:

Young's modulus, E is given as 10000 ksi,

μ is given as 0.33,

Inside diameter, d = 54 in,

Thickness, t = 1 in,

Pressure, p = 794 psi = 0.794 ksi

To determine shear strain, longitudinal strain and circumferential strain will be evaluated,

Longitudinal strain, eL = (pd/4tE)(1 - 2μ)

eL = (0.794 x 54)(1 - 0.66)/(4 x 1 x 10000)

eL = 3.64 x 10-⁴ radians

Circumferential strain , eH = (pd/4tE)(2-μ)

eH = (0.794 x 54)(2 - 0.33)/(4 x 1 x 10000)

eH = 1.79 x 10-³ radians

The maximum shear strain is 1790 μrad.

4 0
3 years ago
When would working with machinery be a common type of caught-in and caught-between<br> hazard?
tigry1 [53]

Answer:

A working with machinery be a common type of caught-in and caught-between  hazard is described below in complete detail.

Explanation:

“Caught in-between” accidents kill mechanics in a variety of techniques. These incorporate cave-ins and other hazards of tunneling activity; body parts extracted into unconscious machinery; reaching within the swing range of cranes and other installation material; caught between machine & fixed objects.

6 0
3 years ago
Info security:
il63 [147K]

Answer:

True

Explanation:

Dual home host - it is referred to as the firewall that is incorporated with two or more networks. out of these two networks, one is assigned to the internal network and the other is for the network. The main purpose of the dual-homed host is to ensure that no Internet protocol traffic is induced between both the network.

The most simple example of a dual-homed host is a computing motherboard that is provided with two network interfaces.

7 0
3 years ago
The properties of the air in the inlet section with A1 = 0.25ab m2 in a converging-diverging channel are given as U1 = 25a,b m/s
NeX [460]

Answer:

nice cake

Explanation:

3 0
3 years ago
Type the correct answer in the box. Spell all words correctly.
Rudik [331]

Answer:ii dant overstand

Explanation:

5 0
2 years ago
Other questions:
  • What is 1000 kJ/sec in watts?
    10·1 answer
  • What is the one change that golden expects to see in public transportation?
    12·1 answer
  • The working section of a transonic wind tunnel has a cross-sectional area 0.5 m2. Upstream, where the cross-section area is 2 m2
    10·1 answer
  • The specific gravity of a substance that has mass of 10 kg and occupies a volume of 0.02 m^3 is a) 0.5 b) 1.5 c) 2.5 d) 3.5 e) n
    11·1 answer
  • PLEASE ANSWER FOR DRIVERS ED! WILL GIVE BRAINLIEST
    10·1 answer
  • Write a function named is_float(s) that takes one argument that is a string. It returns True if string s represents a floating p
    6·1 answer
  • Let CFG G be the following grammar.
    7·2 answers
  • Create a Relational Schema for the following scenario. Include all primary and foreign keys and list any assumptions you make. 
    15·1 answer
  • Why charles babbage is known as father of computer explain <br>​
    12·1 answer
  • Saferty precautions of drill press​
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!