1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
lidiya [134]
3 years ago
12

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 absolut

e 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
Computers and Technology
1 answer:
STALIN [3.7K]3 years ago
6 0

Solution :

x = float_(input())

y = float_(input())

z = float_(input())

res1 = x**z

res2 = x**(y**z)

res3 = abs(x-y)

res4 = (x**z)**0.5

print('{:.2f} {:.2f} {:.2f} {:.2f}'.format(res1,res2,res3,res4))

Output is :

5.0

1.5

3.2

172.47 361.66 3.50 13.13

You might be interested in
Two students are discussing the flow of electricity. Student A says that voltage is a measure of the amount of electron flow in
aivan3 [116]

The answer is C: Both of the two students are correct.

Voltage in very simple terms is what makes electric charges move. It is that push or force that causes charges to move in an electrical conductor. Thus, student A is correct since voltage is a specific measure of potential energy that exists and is always relative between two points. On the other hand, power is the rate, per unit time, at which electrical energy travels. Electrical power (P) is the product of both voltage and current and not either one separately. It is a function of voltage and current. Thus, student B is also correct.

3 0
3 years ago
Write a program that prompts the user to enter the year and the first three letters of a month name (with the first letter in up
elena55 [62]

Answer:

I am writing a C++ program.

#include <iostream> // for input output functions

using namespace std; // to identify objects like cout, cin

int main() { // start of main() function body

   int year; // stores the year entered

   string month;  // holds the letters of a month

   cout<<"Enter the Year: "; // prompts user to enter year

   cin>>year; // reads year entered by user

   cout<<"Enter first three letters of a month ";

// prompts user to enter first three letters of a month

   cin>>month;    //reads the three letters of month entered by the user

// formula to determine leap year

   bool leapYear =((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);

//if checks if the 3 letters of input month match with one from these months  

if ( month == "Jan" || month =="Mar" || month == "May" || month == "Jul" || month == "Aug"|| month == "Oct"|| month == "Dec")

 //displays no of days in input month and year are 31

 cout<<"Number of days in "<<month<<" "<<year<<": 31 ";

//else- if checks if the input month matches with one from these months

else if (month =="Apr" || month=="Jun"|| month == "Sep"|| month == "Nov")

 //displays no of days in input month and year are 31

       cout<<"Number of days in "<<month<<" "<<year<<": 30 ";

else if (month =="Feb") //if the input month is Feb

cout<<"Number of days in "<<month<<" "<<year<<": "<<((leapYear) ? 29 : 28); // checks if the year is leap if yes then displays 29 days else 28

else //if none of the above if else conditions is true

{cout<<"Not a valid entry"; //displays invalid entry

    exit(0); //exits the program } }

             

Explanation:

The basic working of this program is briefly described in the comments above. I will explain the logic of the program.

This program takes int type year and a string month from the user (first three letters of the month).

Then it computes that if the year entered by the user is a leap year by this formula:

((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)

A leap year has 366 days and year which is not a leap year has 365 days. modulus operator is used here which returns the remainder of the division. If the input year is completely divisible by 4 which means we get remainder 0 then mod of year is taken with 100.  If the input year is evenly divisible by 100 then mode of year is taken with 400. Then if the input year is completely divisible by 400 this means the year is a leap year. Otherwise, year is not a leap year.

Next the IF statement is used to check the condition if the first three letters the month entered by the user matches one of the those mentioned in the if statement. As we know that the months Jan, March, May, July, Aug, Oct and Dec have 31 days so if the input month is any of these months then the message is displayed that the month has 31 days.

If the input month is not from the above months then else-if part is checked for input month. If the input month's letters matches with any of the months in else-if condition then the message displayed that the input year and month has 30 days.

If the above if and else if statement evaluate to false then the second else-if part is executed which checks if the input month is Feb, if its true the conditional statement checks if the input year is a leap year or not. If the input year is a leap year then the month Feb has 29 days otherwise 28 days.

If none of the above conditions are true this means that the user might be entering wrong letters such as Fab or Aig etc instead of Feb or Aug, so the message printed : Not a valid entry and program exits.

Screenshot of program along with its output is attached.

5 0
3 years ago
Question 1 (1 point)
Pachacha [2.7K]

Answer:

The answers are in the Explination :3

Explanation:

Question 1 - Portrait and Landscape.

Question 2 - Header and Footer

Question 3 - Formatting

Question 4 - Ctrl + Enter

Question 5 - Margins

7 0
2 years ago
Technically
Sedaia [141]

The answer should be True


7 0
3 years ago
What two variables does mass depend on?
Ber [7]

Answer:       The answer to your question would be A

have a good day

Explanation:

4 0
3 years ago
Other questions:
  • Jason wants to open a program with the command prompt window. Which command should he type in the Run dialog box to open the com
    10·1 answer
  • If the current through a heater coil is 5 amp and the supply voltage is 120 volts, the coil resistance is A. 0.04 ohm. B. 24 ohm
    6·1 answer
  • ____ the styles allows the designer to start from a known baseline, confident that no unwanted styles will creep in from any bro
    6·1 answer
  • What do you like and dislike about school? ANDWER FAST!!!
    5·2 answers
  • You are asked to check your company’s configurations to determine if any filters should be built to stop certain ICMPv6 traffic.
    9·1 answer
  • If tech is smarter than us. How did a human make something smarter than him/her?
    9·2 answers
  • Flash drive DVD and hard drive are all examples of
    6·2 answers
  • Avi does not want to save his internet browsing details on his computer. What should he do?
    11·1 answer
  • Why would an end-user not generally buy a server? Explain your answer by referring to the typical role that servers perform. ​
    12·1 answer
  • . Imagine that you were programming without an IDE. What problems might you encounter?​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!