Posts

Showing posts with the label Array

Using flow control commands for Array processing

Creating two arrays, one to accommodate the positive, and the other to accommodate the negative elements of the predefined array, and the necessary logic that will execute the drawing of the appropriate elements in the appropriate array. Elements of equal zero should not be inserted into the resulting arrays. It is also necessary to determine the number of duplicates in given array. In this case, the elements that are equal to zero must be counted as well. In doing so, you do not need to print how many times each element of the array repeats, but count and print only those repeating elements and how many times. Of course, logic has to be applicable for any given array. Created on: Dec. 13. 2016. 1: /* 2: * Using flow control commands for Array processing 3: */ 4: package jcpa1; 5: import java.util.Arrays; 6: 7: /** 8: * 9: * @author Djordje Gavrilovic 10: * Dec 13 2016 11: */ 12: public class Main { 13: 14: public static void main(...