subject
Computers and Technology, 05.09.2020 05:01 mccdp55

A variable like userNum can store a value like an integer. Extend the given program to print userNum values as indicated. (1) Output 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: 44 squared is 16 And 4 cubed is 64 Enter another integer: 5 4 + 5 is 9 4 * 5 is 20import java. util. Scanner;public class OutputWithVars {public static void main(String[] args) {Scanner scnr = new Scanner(System. in);int userNum = 0;System. out. println("Enter integer: ");userNum = scnr. nextInt();return;}}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 14:20
Consider a byte-addressable computer with 16mb of main memory, a cache capable of storing a total of 64kb of data and block size of 32 bytes. (a) how many bits in the memory address? (b) how many blocks are in the cache? (c) specify the format of the memory address, including names and sizes, when the cache is: 1. direct-mapped 2. 4-way set associative 3. fully associative
Answers: 2
question
Computers and Technology, 22.06.2019 23:50
List a few alternative options and input and output over the standerd keyboard and monitor. explain their functioning in details.
Answers: 2
question
Computers and Technology, 23.06.2019 03:30
In vista and windows 7, the appearance and personalization option allows you to change the
Answers: 1
question
Computers and Technology, 23.06.2019 05:20
What did creator markus “notch" persson initially call his game
Answers: 1
You know the right answer?
A variable like userNum can store a value like an integer. Extend the given program to print userNum...
Questions
question
Chemistry, 08.03.2021 05:20
question
Mathematics, 08.03.2021 05:20
question
Biology, 08.03.2021 05:20
question
Mathematics, 08.03.2021 05:20
question
Mathematics, 08.03.2021 05:20
question
Mathematics, 08.03.2021 05:20