Java – Solved

$ 20.99
Category:

Description

Introduction to Programming
with Java

Class: SplitArray.java
Score: (Easy)

Description:
Write a program that creates an array with random numbers then splits the array into 2 halves at its middle point. Size of the array arraySize is taken from the user. Note that your program should fill the all elements of array with random numbers in range [0-10].

You can split odd sized arrays at the point (arraySize-1) / 2

Sample Run:
This program generates random numbers and split them.
Enter how many random numbers to generate: 6
Main Array Contents: [5, 2, 5, 3, 3, 3]
First Half Contents:
[5, 2, 5]
Second Half Contents:
[3, 3, 3]

Reviews

There are no reviews yet.

Be the first to review “Java – Solved”

Your email address will not be published. Required fields are marked *