D zyBooks cata 3.19 LAB: Using math methods (expressions) Given three floating-p
ID: 3744989 • Letter: D
Question
D zyBooks cata 3.19 LAB: Using math methods (expressions) 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 u, the absolute valkue of x and the square root of (xy to the power of z) Ex: It the input is 506.53 2, the output is 34938.56214843421 1.29951434017329188279 5.0 262.42993783925596 LAD NCTIVITY 3.191 LAB Using math methods (expressians 0710 LabProgram.java Load dafault tomplate 1 inport dave.util Scanner public class Labprogan 4pubic stati vaid rainstringtt ars Scenner senr-new scacner(Syicen.in) double x ouble v Run your program as often as youd ie befors suarniaing tor greana elil yoeany needed nput values in the first box then click Run program and observe the pregrams output in the Submit mode Develop mode Enter program input (optional)Explanation / Answer
import java.util.Scanner; public class LabProgram { public static void main(String[] args) { Scanner in = new Scanner(System.in); double x, y, z; x = in.nextDouble(); y = in.nextDouble(); z = in.nextDouble(); System.out.println(Math.pow(x, y) + " " + Math.pow(x, Math.pow(y, z)) + " " + Math.abs(x) + " " + Math.sqrt(Math.pow(x*y, z))); } }
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.