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
BigorU [14]
4 years ago
4

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 pow

er 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
the output is: 172.47 340002948455826440449068892160.00 6.50 262.43
Computers and Technology
1 answer:
Gekata [30.6K]4 years ago
4 0

Answer:

import math

x = float(input())

y = float(input())

z = float(input())

value1 = pow(x, z)

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

value3 = abs(x - y)

value4 =  math.sqrt(pow(x, z))

print('{:.2f} {:.2f} {:.2f} {:.2f}'.format(value1, value2, value3, value4))

Explanation:

*The code is in Python.

Ask the user to enter x, y, and z as floating point numbers

Calculate the each expression using math functions, pow - calculates the power, abs - calculates the absolute value, and sqrt - calculates the square root

Print the values in required format

Note that the given output is not correct. It must be:

172.47 361.66 3.50 13.13

You might be interested in
"Career Clusters" describe a group of ________ within the same industry
enyata [817]

Answer:

careers

Explanation:

3 0
3 years ago
List and describe two of the four generally recognized security positions.
Llana [10]
CISO: This person reports directly to the CIO and is responsible for assessing, managing, and implementing security.
Security Technician: Entry-level position and provides technical support to conFgure security hardware, implement security software, and diagnose and troubleshoot <span>problems</span>
8 0
4 years ago
I need app ideas please help​
Artemon [7]

Answer:

I have a few ideas although most are simple and for nothing too useful

1. ghost simulator (you can like haunt people and mess with all their stuff and the more u f with them tge more points and the higher level u get you get more power and more ability to mess with things like eventually you'll be able to possess things and ig the goal wou.d be to either kill the person living in your house or scare them until they run away and there can be little side missions for like extra points and accessories n stuff)

2. my forest (you have workers that make money and the more money you get the more stuff u can buy for your forest and you can customize it and it's pretty much like a therapeutical thing where you can make a pretty forest w mystical creatures and stuff

3. egg (its literally just an egg on the screen that's it there is just an egg)

Explanation:

first things that came to mind I just like brainstorming at these kinda things lmk if u plan on using any aspect of my ideas I'd love to see your app

4 0
3 years ago
Select the correct answer.
ale4655 [162]

Answer:

I think it's B

Explanation:

6 0
3 years ago
Read 2 more answers
This is a program that calculates information about orders of shirts and pants. All orders have a quantity and a color. Write a
LuckyWell [14K]

Answer:

Check the explanation

Explanation:

// Clothing.java

public class Clothing {

//Declaring instance variables

private int quantity;

private String color;

//Zero argumented constructor

public Clothing() {

this.quantity = 0;

this.color = "";

}

//Parameterized constructor

public Clothing(int quantity, String color) {

this.quantity = quantity;

this.color = color;

}

// getters and setters

public int getQuantity() {

return quantity;

}

public void setQuantity(int quantity) {

this.quantity = quantity;

}

public String getColor() {

return color;

}

public void setColor(String color) {

this.color = color;

}

public double calculatePrice()

{

return 0.0;

}

}

_____________________________

// Pants.java

public class Pants extends Clothing {

//Declaring instance variables

private int waist;

private int inseam;

//Zero argumented constructor

public Pants() {

this.waist = 0;

this.inseam = 0;

}

//Parameterized constructor

public Pants(int quantity, String color, int waist, int inseam) {

super(quantity, color);

setWaist(waist);

setInseam(inseam);

}

// getters and setters

public int getWaist() {

return waist;

}

public void setWaist(int waist) {

if (waist > 0)

this.waist = waist;

}

public int getInseam() {

return inseam;

}

public void setInseam(int inseam) {

if (inseam > 0)

this.inseam = inseam;

}

public double calculatePrice() {

double tot = 0;

if (waist > 48 || inseam > 36) {

tot = 65.50;

} else {

tot = 50.0;

}

return tot;

}

}

__________________________

// Shirt.java

public class Shirt extends Clothing {

//Declaring instance variables

private String size;

//Zero argumented constructor

public Shirt() {

this.size = "";

}

//Parameterized constructor

public Shirt(int quantity, String color, String size) {

super(quantity, color);

this.size = size;

}

// getters and setters

public String getSize() {

return size;

}

public void setSize(String size) {

this.size = size;

}

public double calculatePrice() {

double tot = 0;

if (size.equalsIgnoreCase("S")) {

tot = getQuantity() * 11.00;

} else if (size.equalsIgnoreCase("M")) {

tot = getQuantity() * 12.50;

} else if (size.equalsIgnoreCase("L")) {

tot = getQuantity() * 15.00;

} else if (size.equalsIgnoreCase("XL")) {

tot = getQuantity() * 16.50;

} else if (size.equalsIgnoreCase("XXL")) {

tot = getQuantity() * 18.50;

}

return tot;

}

}

___________________________

//Test.java

import java.util.ArrayList;

public class Test {

public static void main(String[] args) {

int totShirts=0,totPants=0;

double sprice=0,pprice=0,totWaist=0,totinseam=0,avgWaist=0,avginseam=0;

int cnt=0;

ArrayList<Clothing> clothes=new ArrayList<Clothing>();

Shirt s=new Shirt(8,"Green","XXL");

Pants p1=new Pants(6,"Brown",48,30);

Pants p2=new Pants(4,"Blue",36,34);

clothes.add(s);

clothes.add(p1);

clothes.add(p2);

for(int i=0;i<clothes.size();i++)

{

if(clothes.get(i) instanceof Shirt)

{

Shirt s1=(Shirt)clothes.get(i);

totShirts+=s1.getQuantity();

sprice+=s1.calculatePrice();

}

else if(clothes.get(i) instanceof Pants)

{

Pants pa=(Pants)clothes.get(i);

totPants+=pa.getQuantity();

pprice+=pa.calculatePrice();

totinseam+=pa.getInseam();

totWaist+=pa.getWaist();

cnt++;

}

}

System.out.println("Total number of shirts :"+totShirts);

System.out.println("Total price of Shirts :"+sprice);

System.out.println("Total number of Pants :"+totPants);

System.out.println("Total price of Pants :"+pprice);

System.out.printf("Average waist size is :%.1f\n",totWaist/cnt);

System.out.printf("Average inseam length is :%.1f\n",totinseam/cnt);

 

}

}

_________________________

Output:

Total number of shirts :8

Total price of Shirts :148.0

Total number of Pants :10

Total price of Pants :100.0

Average waist size is :42.0

Average inseam length is :32.0

4 0
4 years ago
Other questions:
  • In the 1960s, techniques were developed that allowed individuals to fool the phone system into providing free access to long dis
    14·1 answer
  • Do you think you would share hardware or software resources in a LAN and why?
    14·1 answer
  • Which computer network component allows data transfers from one computer to another through a telephone line?
    11·2 answers
  • _____ refers to unsolicited commercial emails, usually sent to a large number of people with little regard to the users interest
    14·1 answer
  • Which option allows you to view slides on the full computer screen?
    11·1 answer
  • Assembly language program wich indetify largest number from the five elements 51,44,67,30,99​
    13·1 answer
  • In python:
    8·1 answer
  • Assignment 2: room area <br>programming python in Project Stem​
    8·1 answer
  • Need help with Python coding from Zybooks...
    9·1 answer
  • A ____ attack is much more substantial than a dos attack because of the use of multiple systems to simultaneously attack a singl
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!