..• 6. Modify the following program so that it terminates, printing "Invalid input" as soon as an invalid input is detected. If both inputs are valid, print their product. Test.java...


..• 6. Modify the following program so that it terminates, printing

Extracted text: ..• 6. Modify the following program so that it terminates, printing "Invalid input" as soon as an invalid input is detected. If both inputs are valid, print their product. Test.java ebook-bjlo-2-ch03-sec08-cc-1ava.util.Scanner; 2 3 public class Test 4 { public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.print("Enter an integer: "); in.nextInt(); 9. 10 int m = 11 System.out.print("Enter another integer: "); 12 int n = in.nextInt(); 13 System.out.println("Product: " + m * n); 14 15 } CodeCheck Reset

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here