Created
May 21, 2017 16:49
-
-
Save peter279k/aaf919ae5ad4f4475a6a2cbf529eae07 to your computer and use it in GitHub Desktop.
TQC+ JAVA
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 JPA01 { | |
public static void main(String []args) { | |
double res = 0.0; | |
double []nums = {-3.2, -2.1, 0, 2.1}; | |
for(int index=0;index<nums.length;index++) { | |
res = 3 * Math.pow(nums[index], 3) + 2 * nums[index] - 1; | |
System.out.printf("f(%s) = %.4f\r\n", nums[index], res); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment