Question: CHALLENGE 5.5.1: Unit testing ACTIVITY Add two more statements to main0 to test inputs 3 and-1. Use print statements similar to the existing t statements
CHALLENGE 5.5.1: Unit testing ACTIVITY Add two more statements to main0 to test inputs 3 and-1. Use print statements similar to the existing t statements similar to the existing one (don't use assert). 1 import java.util.Scanner 3 public class UnitTesting f 41 Function returns origNum cubed 5 public static int cubeNumCint origNum) return origNum origNum origNum 9 public static void main (String args) 10 System.out.printinC"Testing storted") 12 13 14 15 16 17 System.out.printlnC"2, expecting 8, got: cubeNum(2)) / Your solution goes here System.out.printin"Testing completed"); 18 H Run ACTVEN531: Methods: Factoring out a unit-conversion calculation. Write a method so that the main0 code below can be replaced by the simpler code that calls method mphAndMinutes ToMiles0 Original mainO public class CalcMiles publie statie void main(String 11 arga) double nilesPerHour70.0 double minutestraveled 100.0 double hoursTraveledi double milesTraveled hoursTraveled minutesTraveled /60.0 nilesTraveled hourstraveled milesFerHour System.out.printin("MilesmilesTraveled) 1 import java.util.Scanner 3 public class CaloMtiles 5 Your solution goes here 1 test 7 public static void mpin(String args) t double milesPerHour 70.0 double minutesTraveled 100.0 10 System.out.printlnC"Miles: mphAndtinutesToMiles(milesPerHour, minutesTraveled)); 12 13 H
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
