Given three floating point numbers x, y, and z, output x to the power of y, x to the power of (y to the power of z), the absolute value of x

Question

Given three floating point numbers x, y, and z, output x to the power of y, x to the power of (y to the power of z), the absolute value of x, and the square root of xy to the power of z). Ex: If the input is 5.0 6.5 3.2, the output is: a. 34938.56214843421 b. 1.2995143401732918e+279 c. 5.0 d. 262.42993783925596 Hint: Coral has built-in math functions (discussed elsewhere) that may be used.

in progress 0
Mackenzie 2 weeks 2022-01-06T04:12:17+00:00 1 Answer 0 views 0

Answers ( )

    0
    2022-01-06T04:13:39+00:00

    Answer & Explanation

    // This program is written in Coral Programming Language

    // Comments are used for explanatory purpose

    //The next 4 lines declares 4 variables. x,y,z and temp. temp is used as a temporary variable

    float x

    float y

    float z

    float temp

    x = Get next input

    y = Get next input

    z = Get next input

    temp = x // Assign the value of x to a temporary variable. The temporary variable will be used later

    // The next line prints x raise to power y

    Put RaiseToPower(x,y) to output

    Put “\n” to output

    //The next two lines calculate and print x raise to power y raise to power z

    x = RaiseToPower (x,y)

    Put RaiseToPower (x,z) to output

    Put “\n” to output

    x = temp

    //The next two lines calculate and print the absolute value of x

    Put AbsoluteValue(x) to output

    The next 3 lines calculate and print the square root of xy raise to power of z

    x = x * y

    x = SquareRoot(x)

    Put RaiseToPower (x,z) to output.

    // End of Program

Leave an answer

45:7+7-4:2-5:5*4+35:2 =? ( )