CSE 1020 - Sample labtest

Phase 1

Present the user with the following prompt.
Enter a number: 
The entry has to be made on the same line as the prompt.

Here is a sample run (including the integer entered by the user):

Enter an integer: 5

Phase 2

Next, expand your program to read the entered integer. You may assume that the user always enters an integer.

Phase 3

Next, expand your program to print the square root of the entered number. When printing the square root use two digits precision.

Here is a sample run (including the output and input of the earlier phases as well):

Enter an integer: 5
The square root of 5 is 2.24 

Phase 4

Finally, expand your program to print the difference between the and the integer entered by the user and sqrt * sqrt, where sqrt is the computed square root. When printing this difference use 15 digits precision.

Here is a sample run (including the output and input of the earlier phases as well):

Enter an integer: 5
The square root of 5 is 2.24 
Precision: 0.000000000000001