Question: 1.16 Basic output with variables (Java) hos (1) Outout the user's input, Enter integer: 4 You entered: 4 (2) Extend to output the input squared
1.16 Basic output with variables (Java)

hos (1) Outout the user's input, Enter integer: 4 You entered: 4 (2) Extend to output the input squared and cubed. Hint. Compute squared as userNum UserNum. (Submit for 2 points, so 4 points total). Enter integer: 4 You entered: 4 4 squared is 16 And 4 cubed is 64!! (3) Extend to get a second user input into userNum2. Output sum and product. (Submit for 1 point, so 5 points total). Enter integer: 4 You entered: 4 4 squared is 16 And 4 cubed is 64!! Enter another integer: 5 4 + 5 is 9 4 * 5 is 20 282002 077058 LAD ACTIVITY 1.16.1: Basic output with variables (Java) 0/5 OutputWithVars.java Load default template 1 import java.util.Scanner; 2 3 public class OutputWithars 4. public static void main(String[] args) { 5 Scanner sehr = new Scanner(System.in); 6 int user Num=; 7 System.out.println("Enter integer: "); 9 user Nun - sehr.nextInt(); 10 11 return; 12 13 } 8
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
