8.18 LAB: Number pattern Write a recursive method called printNumPattern() to output the following number pattern. Given a positive integer as input (Ex: 12), subtract another positive integer (Ex: 3)...


Needs for this activity too.


Image this attached. Thanks


8.18 LAB: Number pattern<br>Write a recursive method called printNumPattern() to output the following number pattern.<br>Given a positive integer as input (Ex: 12), subtract another positive integer (Ex: 3) continually until 0 or a negative value is reached, and then<br>continually add the second integer until the first integer is again reached. For this lab, do not end output with a newline.<br>Ex. If the input is:<br>12<br>3<br>the output is:<br>12 9 6 3 0 3 6 9 12<br>318446.2220060.qx3zay7<br>LAB<br>8.18.1: LAB: Number pattern<br>0/10<br>ACTIVITY<br>NumberPattern.java<br>Load default template.<br>import java.util.Scanner;<br>public class NumberPattern {<br>// TODO: Write recursive printNumPattern () method<br>public static void main (String[] args) {<br>Scanner scnr = new Scanner (System.in);<br>int numl;<br>int num2;<br>numl = scnr.nextInt ();<br>num2 = scnr.nextInt ();<br>printNumPattern (numl, num2);<br>

Extracted text: 8.18 LAB: Number pattern Write a recursive method called printNumPattern() to output the following number pattern. Given a positive integer as input (Ex: 12), subtract another positive integer (Ex: 3) continually until 0 or a negative value is reached, and then continually add the second integer until the first integer is again reached. For this lab, do not end output with a newline. Ex. If the input is: 12 3 the output is: 12 9 6 3 0 3 6 9 12 318446.2220060.qx3zay7 LAB 8.18.1: LAB: Number pattern 0/10 ACTIVITY NumberPattern.java Load default template. import java.util.Scanner; public class NumberPattern { // TODO: Write recursive printNumPattern () method public static void main (String[] args) { Scanner scnr = new Scanner (System.in); int numl; int num2; numl = scnr.nextInt (); num2 = scnr.nextInt (); printNumPattern (numl, num2);

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here