Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. package exercise;
  2.  
  3. public class exercise {
  4.  
  5. public static void main(String[] args) {
  6. int cost = 70;
  7. double vat = 0.20;
  8. double rate = cost * vat;
  9. double total = cost + rate;
  10. System.out.println("Cost: " + "£" + cost);
  11. System.out.println("VAT: £" + cost * vat);
  12. System.out.printf("Total: £%4.2f" , total);
  13. }
  14.  
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement