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
Xyxyydfufggivivihogcufuf​
Genrish500 [490]

Answer:

ummm why is you doing this

Explanation:

It doesnt make sense.

7 0
3 years ago
Anne works with other engineers studying physical processes that involve the flow of particles. Which field of engineering would
slega [8]

Answer:

Option A

Chemical engineering

Explanation:

Chemical engineering mainly encompass the study of behavior of different particles such as petroleum, water, drugs and other products. When Anne is involved in a study with engineers who study flow of particles, the flow, viscosity and other properties are among the behavior that chemical engineers are involved in.

3 0
3 years ago
Based on these statements:
Evgen [1.6K]

Answer:

the third statement is true

Explanation:

given data

Lenovos cost more than Dells

Lenovos cost less than Apples

solution

we have given 1st statement that is express as

cost (Lenovo) > cost (Dell)     ..................1

and

2nd statement that is express as

cost (Lenovo) < cost (Apple)

so we can say it as

cost (Apple) > cost (Lenovo)       ......................2

and

now above Both equation 1 and 2 can be written as

cost (Apple) > cost (Lenovo) > cost (Dell)      .........................3

so we can say cost of Apples is more than the cost of Lenovos and the cost of Dells

so as that given 3rd statement is true

7 0
3 years ago
Analyse what effect the building of an airport may have on the decision of how to use an area of land nearby. (6)​
Sonja [21]
An effect might be a customer not wanting to buy it specifically because it’s by an airport, or maybe the customer wants to buy it because it’s right next to the airport, and a lot of people go to the airport so therefore they might go to the building next to the airport.
5 0
3 years ago
If two statements are inconsistent with each other, at least one of them must be false. a)-True b)-False
olchik [2.2K]

Answer:

a)- True

Explanation:

If two statements are inconsistent with each other it means that they are not telling the same, if they are not telling the same it means that only one of them COULD be true, but there is a third option where the two statements are wrong and non statement is telling the true...so:

If we have two statements inconsistent with each other, AT LEAST one of the statements is false.

7 0
3 years ago
Other questions:
  • A large well-mixed tank of unknown volume, open to the atmosphere initially, contains pure water. The initial height of the solu
    12·1 answer
  • What is the difference between a job and a profession
    9·1 answer
  • I need solution for this question please ​
    7·2 answers
  • Calculate the resistance using Voltage and current, again using voltage and power, again using current and power, and again usin
    12·1 answer
  • A ship tows a submerged cylinder, 1.5 m in diameter and 22 m long, at U = 5 m/s in fresh water at 20°C. Estimate the towing powe
    14·1 answer
  • Can you guys please introduce yourself​
    15·2 answers
  • Glyphicons is mainly used for​
    12·1 answer
  • A large building will need several different types of workmen to install and repair pipes for water, heating,
    10·1 answer
  • A 100-ampere resistor bank is connected to a controller with conductor insulation rated 75°C. The resistors are not used in conj
    8·1 answer
  • saan nag tungo si Aguinaldo at ilang pinuno ng kilusan pagkatapos mapairal ang kasunduan na pansamantalang nag dulot ng kapayapa
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!