Question: sPositive is a method that accept an array as parameter, and checks if each element in the array arr positive or not positive If the

sPositive is a method that accept an array as parameter, and checks if each element in the array arr positive or not positive

If the element is positive print positive else print not positive

Complete main method by calling isPositive method.

Note: you might want to use for loop and if/else statement

Note: your first input is the number of ints in array, all other inputs will be values of array's elements.

-------------------------------------------------------------------------------------------------------------------------------------

import java.util.*;

class Main {

public static void main(String[] args) { Scanner inp = new Scanner(System.in); int size = inp.nextInt(); //#2 Your code here }

public static void isPos(int[] arr) { //#1 your code here

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!