Question: Use scnr . nextInt ( ) to read integers from input into inputData until 1 0 0 is read. For each remaining integer read before

Use scnr.nextInt() to read integers from input into inputData until 100 is read. For each remaining integer read before 100, if the
integer is positive, output the integer followed by a newline and multiply partialProduct by the integer.
Ex: If the input is -97,8,100, then the output is:
7
8
The product of all positive integers is 56
Note: The sentinel value is 100.
import java.util.scanner;
public class Partialproduct {
public static void main(string[] args){
Scanner scnr = new Scanner(
System.in);
int inputData;
int partialproduct;
partialproduct =1;
V** Your code goes here */
}
System.out.println("The product of all positive integers is "+ partialproduct);
}
 Use scnr.nextInt() to read integers from input into inputData until 100

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!