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
Implement the following Matlab code:
vagabundo [1.1K]
28384 *x soít cos estematema
3 0
3 years ago
B. Is the “Loading Time” of any online application a functional or a non-functional requirement? Can the requirement engineers s
Oksi-84 [34.3K]

Answer:

non-functional requirement,

Yes they can.

The application loading time is determined by testing system under various scenarios

Explanation:

non-functional requirement are requirements needed to justify application behavior.

functional requirements are requirements needed to justify what the application will do.

The loading time can be stated with some accuracy level after testing the system.

4 0
3 years ago
The mathematical model for finite element method in structural mechanics is the
zysi [14]

Explanation:

Conservation of velocity equation

3 0
3 years ago
Read 2 more answers
As the junior engineer at the Mesabi Range Hydraulic Engineering Company located in Ely, Minnesota, you have been tasked with de
katen-ka-za [31]

yes it will

Explanation:

5 0
3 years ago
A flat plate 1.5 m long and 1.0 m wide is towed in water at 20 o C in the direction of its length at a speed of 15 cm/s. Determi
beks73 [17]

Answer:

15.8

0.0944

Explanation:

L = 1.5

B = 1.0

Speed of water = 15cm

Temperature = 20⁰C

At 20⁰C

Specific weight = 9790

Kinematic viscosity v = 1.00x10^-4m²/s

Dynamic viscosity u = 1.00x10^-3

Density p = 998kg/m²

Reynolds number

= 0.15x1.5/1.00x10^-4

= 225000

S = 5

5x1.5/225000^1/2

= 0.0158

= 15.8mm

Resistance on one side of plate

F = 0.664x1x1.0x10^-3x0.15x225000^1/2

= 0.04724N

Total resistance

= 2N

= 2x0.04724

= 0.0944N

3 0
3 years ago
Other questions:
  • A evolução da malha rodoviária do Brasil é um marco notável
    9·1 answer
  • Why is it a good idea to lock your doors while driving?<br> WRITER
    10·1 answer
  • A 350 m^3 retention pond that holds rainwater from a shopping mall is empty at the beginning of a rainstorm. The flow rate out o
    7·1 answer
  • A process consists of two steps: (1) One mole of air at T = 800 K and P = 4 bar is cooled at constant volume to T = 350 K. (2) T
    7·1 answer
  • Which of the following allows team members to visualize a design model from a variety of perspectives?
    12·2 answers
  • What is code in Arduino to turn led on and off
    10·1 answer
  • (,,)=^3−^3+^3, where is the sphere ^2 + ^2 + ^2=^
    6·1 answer
  • What are the most used electronic tools for electronic works?​
    13·1 answer
  • a metal rod 24mm diameter and 2m long is subjected to an axial pull of 40 kN. If the rod is 0.5mm, then find the stress-induced
    15·1 answer
  • 11. As __and___ prices continued to rise in the late 1960’s and 70's, 4 and 6 cylinder engines began to make a comeback.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!