package com.company;
public class Main {
public static void main(String[] args) {
double a = (1/84);
double b = Math.sqrt(123456879);
double c = Math.cbrt(2);
double d = Math.PI(Math.sqrt(7));
System.out.printf("%5.6f%n", a);
System.out.printf("%5.6f%n", b);
System.out.printf("%5.6f", c);
}
}
Hey guys, the code above is for few questions i am solving, i am still a newbie at this and would like some help!
Question 1: For "double a = 1/84" should be giving me an actual value but all i am getting is 0.000000, any thoughts ?
Question 2: The square root of 123456789 is 11111.1110606 but in the java program it says 11111.115111, anyway to get a more accurate result ?
Question 3: I need to calculate PI to the power of 7 so i tried Math.PI(Math.sqrt(7)); but it's giving me an error saying "Method call expected" But when i add the multiplication sign between mathPI and mathSQRT "Math.PI*(Math.sqrt(7));" it gives me a different answer than what i wanted.
Thank you guys ^^