Add two more statements to main() to test inputs 3 and-1. Use print statements similar to the existing one (don't use assert). 373020 2041158.qx3zqy7 1 import java.util.Scanner; 3 public class...


I need help solving this in JAVA. The code is split between the two photos


Add two more statements to main() to test inputs 3 and-1. Use print statements similar to the existing one (don't use assert).<br>373020 2041158.qx3zqy7<br>1 import java.util.Scanner;<br>3 public class UnitTesting {<br>// Method returns origNum cubed<br>public static int cubeNum(int origNum) {<br>return origNum * origNum<br>}<br>4<br>All<br>pa<br>origNum;<br>7<br>8.<br>public static void main (String args) {<br>10<br>System.out.println(

Extracted text: Add two more statements to main() to test inputs 3 and-1. Use print statements similar to the existing one (don't use assert). 373020 2041158.qx3zqy7 1 import java.util.Scanner; 3 public class UnitTesting { // Method returns origNum cubed public static int cubeNum(int origNum) { return origNum * origNum } 4 All pa origNum; 7 8. public static void main (String args) { 10 System.out.println("Testing started"); System.out.println("2, expecting 8, got: 11 + cubeNum(2)); %D 12 13 14 * Your solution goes here */ 15
373020.2041158.qx3zqy7<br>// Method returns origNum cubed<br>public static int cubeNum(int origNum) {<br>return origNum * origNum * origNum;<br>}<br>4<br>6.<br>8<br>9.<br>public static void main (String args) {<br>10<br>11<br>System.out.println(

Extracted text: 373020.2041158.qx3zqy7 // Method returns origNum cubed public static int cubeNum(int origNum) { return origNum * origNum * origNum; } 4 6. 8 9. public static void main (String args) { 10 11 System.out.println("Testing started"); System.out.println("2, expecting 8, got: " + cubeNum(2)); 12 %3D 13 14 * Your solution goes here */ 15 16 System.out.println("Testing completed"); } 17 18 }

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here