Because I have not covered the scanner method in my course yet hence this is was not accepted by my teacher. I learned how to do it this way by reading tutorials online in the first place but I was limited to what I have covered only.
Here's what I did after re-reading my book.
import java.util.*;
import javax.swing.*;
public class CH4Q16 {
public static void main(String[] args) {
Random myNums = new Random();
String value;
value = JOptionPane.showInputDialog("Enter The Double Number: ");
double num = Double.parseDouble(value);
double num1=myNums.nextDouble();
for(int i=1;i<16;i++)
{
System.out.println(Math.pow(num, i));
}
}
}
Don't know why I didn't think of that earlier <.<
Thanks for the quick reply though Hello ^^
Hopefully when I improve I can help around here in the future but can't do much now as it's been only a month since I started Java