Project 7

Compound if statements, fabs & pow functions, logical operators, ascii values (75 points)

Sample output1

Please enter a number : 4
Please enter another number : -9
sqrt( 4.000 ) =  2.000
sqrt( -9.000 ) =  3.000i
4.000  -9.000 = -0.444
4.000 ^ -9.000 = 0.000003815


Sample output2

Please enter a number : -2.356
Please enter another number : 8
sqrt( -2.356 ) =  1.535i
sqrt( 8.000 ) =  2.828
-2.356  8.000 = -0.294
-2.356 ^ 8.000 = 949.297222431

Sample output3

Please enter a number : 0
Please enter another number : 5.5
sqrt( 0.000 ) =  0.000
sqrt( 5.500 ) =  2.345
0.000  5.500 = 0.000
0.000 ^ 5.500 = 0.000000000

Sample output4

Please enter a number : -16
Please enter another number : 0
sqrt( -16.000 ) =  4.000i
sqrt( 0.000 ) =  0.000
-16.000  0.000 = undefined
-16.000 ^ 0.000 = 1.000000000

Sample output5

Please enter a number : 0
Please enter another number : 0
sqrt( 0.000 ) =  0.000
sqrt( 0.000 ) =  0.000
0.000  0.000 = undefined
0.000 ^ 0.000 = undefined

Sample output6

Please enter a number : 0
Please enter another number : -0.5
sqrt( 0.000 ) =  0.000
sqrt( -0.5 ) =  0.707i
0.000 -0.500 = 0.000
0.000 ^ -0.500 = undefined