Question: Define the method outputValue() that takes two integer parameters and outputs the product of all negative integers starting with the first and ending with the
Define the method outputValue() that takes two integer parameters and outputs the product of all negative integers starting with the first and ending with the second parameter. If no negative integers exist, product is 1. End with a newline. The method does not return any value. Ex: If the input is -4 7, then the output is:
import java.util.Scanner;
public class ValuePrinter {
/* Your code goes here */
public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int numberA; int numberB;
numberA = scnr.nextInt(); numberB = scnr.nextInt(); outputValue(numberA, numberB); } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
