fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. float w;
  13. float h;
  14. float a;
  15. IO.output("Enter the width of the triangle: ");
  16. w=IO.inputFloat();
  17. IO.output("Enter the height of the triangle: ");
  18. h=IO.inputFloat();
  19. a=(w*h)/2.0;
  20. IO.outputln("The triangle area = "+a);
  21. }
  22. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:15: error: cannot find symbol
        IO.output("Enter the width of the triangle: ");
        ^
  symbol:   variable IO
  location: class Ideone
Main.java:16: error: cannot find symbol
        w=IO.inputFloat();
          ^
  symbol:   variable IO
  location: class Ideone
Main.java:17: error: cannot find symbol
        IO.output("Enter the height of the triangle: ");
        ^
  symbol:   variable IO
  location: class Ideone
Main.java:18: error: cannot find symbol
        h=IO.inputFloat();
          ^
  symbol:   variable IO
  location: class Ideone
Main.java:19: error: incompatible types: possible lossy conversion from double to float
        a=(w*h)/2.0;
               ^
Main.java:20: error: cannot find symbol
        IO.outputln("The triangle area = "+a);
        ^
  symbol:   variable IO
  location: class Ideone
6 errors
stdout
Standard output is empty