Question

Given three floating-point numbers x, y, and z, output x to the power of z, x...

Given three floating-point numbers x, y, and z, output x to the power of z, x to the power of (y to the power of z), the absolute value of (x minus y), and the square root of (x to the power of z).

Output each floating-point value with two digits after the decimal point, which can be achieved as follows:
print('{:.2f} {:.2f} {:.2f} {:.2f}'.format(your_value1, your_value2, your_value3, your_value4))

Ex: If the input is:

5.0
1.5
3.2

Then the output is:

172.47 361.66 3.50 13.13
0 0
Add a comment Improve this question Transcribed image text
Answer #1

import math

x = float(input("Enter 1st number: "))

y = float(input("Enter 2nd number: "))

z = float(input("Enter 3rd number: "))

x_to_the_power_of_z = pow(x, z);

x_to_the_power_of_y_to_the_power_of_z = pow(x, pow(y, z))

absolute_value_of_x_minus_y = abs(x - y)

square_root_of_x_to_the_power_of_z = math.sqrt(x_to_the_power_of_z)

print('{:.2f} {:.2f} {:.2f} {:.2f}'.format(x_to_the_power_of_z, x_to_the_power_of_y_to_the_power_of_z, absolute_value_of_x_minus_y, square_root_of_x_to_the_power_of_z))

******************************************************************** SCREENSHOT *******************************************************

Add a comment
Know the answer?
Add Answer to:
Given three floating-point numbers x, y, and z, output x to the power of z, x...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • In C PLEASE 1.22 LAB: Using math functions Given three floating-point numbers x, y, and z,...

    In C PLEASE 1.22 LAB: Using math functions Given three floating-point numbers x, y, and z, output x to the power of z, x to the power of (y to the power of 2), the absolute value of y, and the square root of (xy to the power of z). Output each floating-point value with two digits after the decimal point, which can be achieved as follows: printf("%0.21f", yourValue); Ex: If the input is: 5.0 6.5 3.2 the output is:...

  • A pedometer treats walking 2,000 steps as walking 1 mile. Write a program whose input is...

    A pedometer treats walking 2,000 steps as walking 1 mile. Write a program whose input is the number of steps, and whose output is the miles walked. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: print('{:.2f}'.format(your_value)) Ex: If the input is: 5345 the output is: 2.67 Your program must define and call the following function. The function should return the amount of miles walked. def steps_to_miles(user_steps) answer must be in Phython...

  • Hi need to design a programm in C++ which reset the output format,i.e Display the number of floating point numbers in th...

    Hi need to design a programm in C++ which reset the output format,i.e Display the number of floating point numbers in the fixed point format according to the system default format. First the Input should be the number of test cases, and then input the test cases. For example: Input: 4 //number of test cases 2123.324423 2123.324423 2123.324423 123.0000 Output: 2123.32 2123.324423 2123.32 2123.324423 2123.32 2123.324423 123 123.000000

  • Code in Coral please 2.17 LAB: Musical note frequencies On a piano, a key has a...

    Code in Coral please 2.17 LAB: Musical note frequencies On a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequency of f0 * rn, where n is the distance (number of keys) from that key, and r is 2(1/12). Given an initial key frequency, output that frequency and the next 4 higher key frequencies. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: print('{:.2f}...

  • A comparison of floating point numbers x and y in practical code is typically given by...

    A comparison of floating point numbers x and y in practical code is typically given by |x − y| < E, for some user-chosen value of E > 0, to replace testing for exact equality by “Does x = y”?. The indicated comparison is not an equivalence relation between x and y. 1Ai. Which needed property fails to hold? (2 pts) 1Aii. Give a specific example of this failure to be an equivalence relation. (3 pts) A comparison of floating...

  • [5 pts] Design a circuit with three inputs (x,y,z) and one output that outputs true if the binary value of the inputs i...

    [5 pts] Design a circuit with three inputs (x,y,z) and one output that outputs true if the binary value of the inputs is a perfect square (it's square root is an integer). Construct the truth table, simplify using a K-map, and draw out the logic circuit diagram [5 pts] Design a circuit with three inputs (x,y,z) and one output that outputs true if the binary value of the inputs is a perfect square (it's square root is an integer). Construct...

  • This problem demonstrates the use of import module. The Python programming language has many strengths, but...

    This problem demonstrates the use of import module. The Python programming language has many strengths, but one of its best is the availability to use many existing modules for various tasks, and you do not need to be an experienced computer programmer to start using these modules. We have given you some incomplete code; note that the very first line of that code contains an import statement as follows: import math This statement enables your program to use a math...

  • 4.16 LAB: Musical note frequencies On a piano, a key has a frequency, say f0. Each...

    4.16 LAB: Musical note frequencies On a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequency of f0* r, where n is the distance (number of keys) from that key, and r is 2(1/12) Given an initial key frequency, output that frequency and the next 4 higher key frequencies. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: print('%0.2f %.2f %0.2f %0.2f %.2f' %...

  • The temperature at any point (x, y, z) in space is T = x y3 z4...

    The temperature at any point (x, y, z) in space is T = x y3 z4 Find the highest temperature on the surface 4 x2 + 4 y2 + z2 = 8. Enter the exact value of your answer in the box below. Warning: If your answer involves a square root, use either sqrt or power 1/2. Note: The highest temperature cannot be 0.

  • In Java The following equations estimate the calories burned when exercising (source): Women: Calories = (...

    In Java The following equations estimate the calories burned when exercising (source): Women: Calories = ( (Age x 0.074) — (Weight x 0.05741) + (Heart Rate x 0.4472) — 20.4022 ) x Time / 4.184 Men: Calories = ( (Age x 0.2017) + (Weight x 0.09036) + (Heart Rate x 0.6309) — 55.0969 ) x Time / 4.184 Write a program using inputs age (years), weight (pounds), heart rate (beats per minute), and time (minutes), respectively. Output calories burned for...

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
ADVERTISEMENT