Question

Help

(1) Output the user's input. (2 pts)

Note: This zyLab outputs a newline after each user-input prompt. For convenience in the examples below, the user's input value is shown on the next line, but such values don't actually appear as output when the program runs.
Enter integer:
4
You entered: 4
(2) Extend to output the input squared and cubed. Hint: Compute squared as userNum * userNum. (2 pts)
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. (1 pt)
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


0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
Help
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • Warm up: Basic output with variables

    1.14 LAB: Warm up: Basic output with variablesThis zyLab activity prepares a student for a full programming assignment. Warm up exercises are typically simpler and worth fewer points than a full programming assignment, and are well-suited for an in-person scheduled lab meeting or as self-practice.A variable like userNum can store a value like an integer. Extend the given program as indicated.Output the user's input. (2 pts)Output the input squared and cubed. Hint: Compute squared as userNum * userNum. (2 pts)Get a second user...

  • 1.20 LAB: Warm up: Basic output with variables This zyLab activity prepares a student for a...

    1.20 LAB: Warm up: Basic output with variables This zyLab activity prepares a student for a full programming assignment. Warm up exercises are typically simpler and worth fewer points than a full programming assignment, and are well-suited for an in-person scheduled lab meeting or as self-practice. A variable like userNum can store a value like an integer. Extend the given program as indicated. Output the user's input. (2 pts) Output the input squared and cubed. Hint: Compute squared as userNum...

  • QUESTION 12 Write a program that would prompt the user to enter an integer. The program...

    QUESTION 12 Write a program that would prompt the user to enter an integer. The program then would displays a table of squares and cubes from 1 to the value entered by the user. The program should prompt the user to continue if they wish. Name your class NumberPowers.java, add header and sample output as block comments and uploaded it to this link. Use these formulas for calculating squares and cubes are: square = x * x cube = x...

  • Write a Java program to prompt for inputting an integer N, then enter N integers (a...

    Write a Java program to prompt for inputting an integer N, then enter N integers (a loop is needed), print the numbers user entered, and the amount of even and odd numbers (zero is even number). (1) Prompt for the user to input an integer and output the integer. (1 pts) Enter an integer: You entered: 5 (2) Prompt for the user to input N integers, output the numbers entered and the amount of even and odd numbers (9 pts)...

  • Please help program in python read all instructions 2.13 LAB*: Program: Cooking measurement converter Output each...

    Please help program in python read all instructions 2.13 LAB*: Program: Cooking measurement converter Output each floating point value with two digits after the decimal point, which can be achieved as follows: print('{:.2f}'.format(your_value) (1) Prompt the user for the number of cups of lemon juice, water, and agave nectar needed to make lemonade. Prompt the user to specify the number of servings the recipe yields. Output the ingredients and serving size. (Submit for 2 points) Note: This zyLab outputs a...

  • 1.8 zyLab training: Basics (Java) While the zyLab platform can be used without training, a bit...

    1.8 zyLab training: Basics (Java) While the zyLab platform can be used without training, a bit of training may help some students avoid common issues. The assignment is to get an integer from input, and output that integer squared, ending with newline. (Note: This assignment is configured to have students programming directly in the zyBook. Instructors may instead require students to upload a file). Below is a program that's been nearly completed for you. Click "Run program". The output is...

  • Problem Description: Create a mathematics library with the following functionality.  calculate the absolute value of...

    Problem Description: Create a mathematics library with the following functionality.  calculate the absolute value of an integer number  calculate the power given an integer base and a positive integer exponent  calculate the square of an integer number  determine if an integer is an even  determine if an integer is prime Write a Java program to do the following: 1. Calculate the absolute value, square, cube (i.e., 3rd power) of the integers 2 through 7. 2....

  • the author's pseudocode    it follows this template 3 Design the logic for a program for Nos...

    the author's pseudocode    it follows this template 3 Design the logic for a program for Nos Encanta Tu Interés credit card company that a) Allows the user to enter their name, credit card number, beginning balane and monthly interest rate b) For the next full year (12 months), 1. Outputs the month number and the balance at the beginning of the month 2. Allows the user to enter the amount of their payment, and the amount of their purchases for...

  • Use C programming Make sure everything works well only upload Write a program that takes an...

    Use C programming Make sure everything works well only upload Write a program that takes an integer from standard input and prints all prime numbers that are smaller than it to standard output. Recall that a prime number is a natural number greater than 1 whose only positive divisors are 1 and itself. At the start of the program, prompt the user to input a number by printing "Input a number greater than 2:\n". If the user's input is less...

  • Auto-graded programming assignments have numerous advantages, but have some challenges too. Students commonly struggle with realizing...

    Auto-graded programming assignments have numerous advantages, but have some challenges too. Students commonly struggle with realizing that example input / output provided in an assignment's specification interleaves input and output, but the program should only output the output parts. If a program should double its input, an instructor might provide this example: Enter x: 5 x doubled is: 10 Students often incorrectly create a program that outputs the 5. Instead, the program should only output the output parts: Enter x:...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT