#Help with this question.Given three floating-point numbers x, y, and z, output x to the power of z,
1 messages · Page 1 of 1 (latest)
<@&987246399047479336> please have a look, thanks.
@quaint laurel do u know how to use scanner?
You'd probably want something that looks like this:
import java.util.Scanner;
public class LabProgram {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
double x;
double y;
double z;
System.out.print("Enter the value of x: ");
x = scnr.nextDouble();
System.out.print("Enter the value of y: ");
y = scnr.nextDouble();
System.out.print("Enter the value of z: ");
z = scnr.nextDouble();
double result = Math.pow(x, z);
System.out.println(x + " raised to the power of " + z + " is: " + result);
scnr.close();
}
}
Do you know how to use Scanner?
please don't spoon-feed. passing them the code won't help them learn how to produce code
I can explain the code once he tells me what he knows and go from there. Don't tell me how to teach people boo xoxo
thats an old assignment im looking back at
its not as easy as it looks because the thing always returns random values for me
What does your code look like then?
i pretty much had to use the math library in a specfic way
show the broken code, the one that returns the random values
show us tho