Re-type the code and fix any errors. The code should convert non-positive numbers to 1. if (userNum > 0) System.out.prin
Posted: Mon Jun 06, 2022 1:25 pm
Re-type the code and fix any errors. The code should convert non-positive numbers to 1. if (userNum > 0) System.out.println("Positive."); else System.out.println("Non-positive, converting to 1."); userNum = 1; System.out.println("Final: " + userNum); Common student error: Changing the order of the lines. You only need to fix the existing code. 400512.2468666.qx3zqy7 1 import java.util.Scanner; 2 3 public class ConvertNegative { 4 public static void main (String[] args) { 5 Scanner scnr = new Scanner(System.in); int userNum; userNum = scnr.nextInt (); in 1000 a 6 7 8 9 10 11 12} T }