Write a complete java program called Practical_3 that has two static methods: main and printing_Array. The main method should: Create an integer array called vectorA and fill it with 15 random numbers between -5 and 10 inclusive. Split vectorA array into two arrays vector_A1 and vector_A2 where vector_A1 array should contain all the elements which are bigger than 5 from vectorA array and vector_A2 should contain all the remaining elements of vectorA array. Call the method printing_Array to print the three arrays vectorA, vector_A1 and vector_A2. Calculate and print the percentage of the bigger than 5 elements in vectorA array. The printing_Array method should: 1. Accept an array of integers. 2. Print the array elements in one line
Q. Write a complete java program called Practical_3 that has two static methods: main and printing_Array.
The main method should:
Create an integer array called vectorA and fill it with 15 random numbers between -5 and 10 inclusive.
Split vectorA array into two arrays vector_A1 and vector_A2 where vector_A1 array should contain all the elements which are bigger than 5 from vectorA array and vector_A2 should contain all the remaining elements of vectorA array.
Call the method printing_Array to print the three arrays vectorA, vector_A1 and vector_A2.
Calculate and print the percentage of the bigger than 5 elements in vectorA array.
The printing_Array method should:
1. Accept an array of integers.
2. Print the array elements in one line
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images