subject

Add two more statements to main() to test inputs 3 and -1. Use print statements similar to the existing one (don't use assert)

import java. util. Scanner;

public class UnitTesting {
// Function returns origNum cubed
public static int cubeNum(int origNum) {
return origNum * origNum * origNum;
}

public static void main (String [] args) {

System. out. println("Testing started");
System. out. println("2, expecting 8, got: " + cubeNum(2));

/* Your solution goes here */

System. out. println("Testing completed");

return;
}
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 13:30
Font size, font style, and are all aspects of character formatting.
Answers: 2
question
Computers and Technology, 23.06.2019 15:00
Jake really works well with numbers and is skilled with computers but doesn't work well with others. which of the jobs discussed in this unit might be best for jake? why?
Answers: 3
question
Computers and Technology, 24.06.2019 00:30
Which boolean operator enables you to exclude a search term? a} not b} and c} or d} plus
Answers: 1
question
Computers and Technology, 24.06.2019 07:00
Why would a business likely use a java applet - to back up their data files for the business - to create a program that a customer can launch in their web browser - to create music on a powerpoint presentation - to organize files on their company directory
Answers: 3
You know the right answer?
Add two more statements to main() to test inputs 3 and -1. Use print statements similar to the exist...
Questions
question
Mathematics, 07.07.2019 14:00