ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 2 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 04 May 2017 My Price 8.00

userNum = int(input('Enter integer: n')

Basic output with variables (Python 3)

main.py  (I PUT THIS AT THE BEGINNING AND THE END SO YOU KNOW WHAT I HAVE AND WHAT I NEED) Lost please help

1 userNum = int(input('Enter integer: n'))

2 print (You entered: ', userNum)  I think this is line two, but not 100% sure and not sure where to go...

This first line is all I have to this. I am suppose to print some lines of code with the above information which are numbered (1), (2), & (3).

A variable like userNum can store a value like an integer. Extend the given program to print userNum values as indicated. (Submit for 2 points).

(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: 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

main.py

1 userNum = int(input('Enter integer: n'))

2 print (You entered: ', userNum)  I think this is line two, but not 100% sure and not sure where to go...

This first line is all I have to this. I am suppose to print some lines of code with the above information which are numbered (1), (2), & (3).

 

 

 

Answers

(11)
Status NEW Posted 04 May 2017 01:05 AM My Price 8.00

Out-----------put----------- an-----------swe-----------r-----------

Attachments

1504559522-Output answer.zip
Not Rated(0)