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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started