1))a loop that reads positive integers from standard input, printing out those values that are greater than 100, and that terminates when it reads an integer that is not positive. The values should be separated by single blank spaces.2))a loop that reads positive integers from standard input, printing out those values that are even, separating them with spaces, and that terminates when it reads an integer that is not positive.3))Write a loop that reads positive integers from standard input and that terminates when it reads an integer that is not positive. After the loop terminates , it prints out the sum of all the even integers read.4))Consider this data sequence: "3 11 5 5 5 2 4 6 6 7 3 -8". Any value that is the same as the immediately preceding value is considered a CONSECUTIVE DUPLICATE. In this example, there are three such consecutive duplicates: the 2nd and 3rd 5s and the second 6. Note that the last 3 is not a consecutive duplicate because it was preceded by a 7.

Respuesta :

For the answer to the question above asking to write a loop that reads positive integers from standard input, printing out those values that are greater than 100, and that terminates when it reads an integer that is not positive. The values should be separated by single blank spaces.2))a loop that reads positive integers from standard input, printing out those values that are even, separating them with spaces, and that terminates when it reads an integer that is not positive.

//use java not javascript
Scanner scan = new Scanner(s); 
int nums[] = new int[2000]; 
int value =1; 
int index = 0; 
\\loop for entering values and save those over 100 in an array 
While( value >= 0 ) \\ as long input is positive number loop continues 


System.out.print("Enter an integer : "); 
value = scan.nextInt( ); 
if(value > 100) 

nums[index] = value; 
index++; 




//Next loop prints the array contents on one line with one space 
for( int i =0; i < nums.length; i++) 

if(nums[i] > 100) 
System.out.print(n

I hope this helps