galinyotsev123

ProgBasicsExam1and2December2018-E01tekkingEquipment

Dec 29th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class E01tekkingEquipment {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. double alpinists = Double.parseDouble(scanner.nextLine());
  8. double carabiners = Double.parseDouble(scanner.nextLine());
  9. double ropes = Double.parseDouble(scanner.nextLine());
  10. double pikels = Double.parseDouble(scanner.nextLine());
  11.  
  12. double carabinersPrice = 36;
  13. double ropesPrice = 3.60;
  14. double pikelsPrice = 19.80;
  15.  
  16. double carabinersTotal = carabiners * carabinersPrice;
  17. double ropeTotal = ropes * ropesPrice;
  18. double pikelTotal = pikels * pikelsPrice;
  19.  
  20. double total = alpinists * (carabinersTotal+ropeTotal+pikelTotal);
  21. double totalPlusVAT = ((total * 20)/100)+ total;
  22.  
  23. System.out.printf("%.2f", totalPlusVAT);
  24.  
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment