Question: Define the method printValue() that takes two integer parameters and outputs the product of all negative integers starting with the first and ending with
Define the method printValue() 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 -47, then the output is: 24 Note: Negative numbers are less than 0. 1 import java.util.Scanner; 2 3 public class ValuePrinter { 4 5 * Your code goes here */ 6 7 8 public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int numberA; 9 int numberB; 10 11 12 13 14 15 16} } numberA= scnr.nextInt(); numberB= scnr.nextInt(); printValue (numberA, numberB);
Step by Step Solution
3.46 Rating (162 Votes )
There are 3 Steps involved in it
Solution Methods are blocks of code that are executed when invoked Upda... View full answer
Get step-by-step solutions from verified subject matter experts
