fork download
  1. package labwork1;
  2.  
  3. import java.util.Scanner;
  4. import static java.lang.Math.*;
  5. /**
  6.  * @author Ivan Cherednichenko
  7.  */
  8. public class LabWork1 {
  9. public static void main(String[] args) {
  10. //Static var by task
  11. final float a, b = -5.3f;
  12. //Request for user enter number for task
  13. System.out.print("Please, enter value x: ");
  14. //Save entered user value
  15. float x = new Scanner(System.in).nextFloat();
  16. //Culculate result and pass it to console
  17. a = (float)((pow(sin(3*x), 2) + pow(abs(pow(E, x) - 2), 1.0/abs(b)))/pow(log10(x), 2));
  18. System.out.println("Result is: " + a);
  19. }
  20. }
  21.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:8: error: class LabWork1 is public, should be declared in a file named LabWork1.java
public class LabWork1 {
       ^
1 error
stdout
Standard output is empty