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
Alecsey [184]
3 years ago
10

4.12 LAB: Using math methods 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 y, and the square root of (xy to the power of z). Ex: If the input is:
Computers and Technology
1 answer:
Greeley [361]3 years ago
4 0

Answer:

The function is as follows:

import math

def func(x,y,z):

   print(math.pow(x, z))

   print(math.pow(x,math.pow(y, z)))

   print(math.fabs(y))

   print(math.sqrt(math.pow(x*y,z)))

Explanation:

This imports the math library

import math

This defines the function

def func(x,y,z):

Print the stated outputs as it is in the question

<em>    print(math.pow(x, z)) ---> x to power x</em>

<em>    print(math.pow(x,math.pow(y, z))) ---- x to power of y of z</em>

<em>    print(math.fabs(y)) ---- absolute of y</em>

<em>    print(math.sqrt(math.pow(x*y,z))) --- square root of xy power x</em>

<em />

You might be interested in
What is the difference between a key and a superkey?
netineya [11]

Answer:

Answered below

Explanation:

A key is a single or combination of many attributes that enable us pull a row of data from a table. Keys are identifiers used to get data seamlessly from the database. A key can be a primary key, secondary key, control key, or super key. A super key is a key or set of attributes use to identify tuples in a database. It can contain extra attributes not necessary for uniquely identifying a database.

4 0
2 years ago
The Circle and CircleTester have been created, but they have errors. The public and private settings for variables and methods a
professor190 [17]

<u>Answer:</u>

CIRCLE.JAVA

public class Circle {

  <em>private</em><em> </em>double radius;

  <em>public</em> Circle(double myRadius) {

    radius = myRadius;

    private void setRadius(int myRadius){

    radius = myRadius;

 }

 <em>public </em>double getDiameter() {

    return radius*2;

 }

 public double getRadius() {

   return radius;

 }

 <em>public </em> double getPerimeter() {

   return Math.PI*getDiameter();

 }

 <em>public</em> String toString() {

    return "Circle with a radius of " + radius;

 }

}

CIRCLE TESTER.JAVA

public class CircleTester {

 public static void main(String[] args) {

    Circle circ = new Circle(10);

    circ.radius = 5;

    System.out.println(circ);

    System.out.println("The diameter is " + circ.getDiameter());

    System.out.println("The perimeter is " + circ.getPerimeter())

 }

}

<u>Explanation:</u>

public class Circle {

  //This could be made private or public.

  //Making it private is better

  <em>private</em><em> </em>double radius;

  //This is a constructor. It should be made public

  //since it would most likely be used in another class

  //to create an object of this class.

  //Making it private means no other external class can create

  //an object of this class.

  //Since the tester class (CIRCLETESTER.java), as shown on line 3,

  // needs to create

  //an object of this class, this should be made public

  <em>public</em> Circle(double myRadius) {

    radius = myRadius;

    private void setRadius(int myRadius){

    radius = myRadius;

 }

 //This should be made public since it will be

// used in another class (CIRCLETESTER.java in this case)

 <em>public </em>double getDiameter() {

    return radius*2;

 }

 public double getRadius() {

   return radius;

 }

 //This should be made public since it will be

 //used in another class (CIRCLETESTER.java)

 <em>public </em> double getPerimeter() {

   return Math.PI*getDiameter();

 }

 //The toString() method is the string representation

 //of an object and is called when there is an attempt to

 //print the object. It should be made public since it will

 //be used in another class (CIRCLETESTER.java)

 <em>public</em> String toString() {

    return "Circle with a radius of " + radius;

 }

}

CIRCLE TESTER.JAVA

public class CircleTester {

 public static void main(String[] args) {

    Circle circ = new Circle(10);

    circ.radius = 5;

    System.out.println(circ);

    System.out.println("The diameter is " + circ.getDiameter());

    System.out.println("The perimeter is " + circ.getPerimeter())

 }

}

8 0
2 years ago
In Outlook 2016, what are the three format options when sending an email message? Check all that apply.
tankabanditka [31]
Plain text, HTML, and rich text.
4 0
2 years ago
3.5 Lesson practice quiz: Edhesive Question 5
Fed [463]

Answer:

There is an error, the else should be after the elif

Explanation:

5 0
2 years ago
with the _______ network topology, reliability is the major advantage while high cost is the disadvantage.
Nady [450]
It's what the chat says, Its hybrid
6 0
3 years ago
Read 2 more answers
Other questions:
  • WHEN COPYING EXISTING SPREADSHEET DATA TO A WORD DOCUMENT YOU NEED TO SELECT?
    12·1 answer
  • What does intergrated organization mean
    15·1 answer
  • Which guideline should you use when downloading software from the Internet?
    15·1 answer
  • who will follow me on tiktok and like all my videos? if you do ill give branlist and give u a shoutout and you can enter my big
    15·1 answer
  • What is the correct order of headers, from left to right, in a completed frame?
    8·1 answer
  • You are splitting up all your apples equally between 3 people. which statement below will calculate how many apples will be left
    12·1 answer
  • 2. Select the things you can do when working with rows in columns in a spreadsheet:
    5·1 answer
  • Which statement is true about hacking?
    11·2 answers
  • The _____________computer function accepts data from input devices and sends it to the computer processor.
    11·1 answer
  • GOOD EVENING, FRIENDS, I WANT TO ASK ON THE ACCOUNT OF HIS NAME‏BENJEMIN360 . THIS ANSWERS ARE VERY WONDERFUL, BUT I CAN'T COMMU
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!