Created
May 20, 2020 18:09
-
-
Save kryvoboker/828a7cc664e7ba56774dfc52e2db22bb to your computer and use it in GitHub Desktop.
HomeWork7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) { | |
int n = 2; | |
for (int i = 1; i <= 10; i++) { | |
System.out.println(getPI("PI", Math.PI, n)); | |
n++; | |
} | |
} | |
public static String getPI(String name, double value, int n) { | |
String textNumber = String.format(name + " = %." + n + "f", value); | |
return textNumber; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment