fork download
  1. package VAT;
  2. import java.io.PrintStream;
  3. import java.util.Scanner;
  4.  
  5. public class VAT_mam {
  6. static final double VAT = 0.21;
  7.  
  8. VAT_mam() {
  9. out = new PrintStream(System.out);
  10. }
  11. void start() {
  12. Scanner in = new Scanner(System.in);
  13. out.printf("Price of product (without VAT): ");
  14. double priceWithoutVAT = in.nextDouble();
  15. double priceWithVAT = priceWithoutVAT
  16. * (1+VAT);
  17. out.printf("The price of the product with VAT is %.2f", priceWithVAT);
  18. }
  19.  
  20. public static void main(String[] args) {
  21. new VAT_mam().start();
  22. }
  23. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:5: error: class VAT_mam is public, should be declared in a file named VAT_mam.java
public class VAT_mam {
       ^
1 error
stdout
Standard output is empty