Advertisement
yovkovbpfps

Simple Operations Trekking Equipement

Apr 20th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class AlpineEquipment {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. int carabiner = 36;
  8. double tire = 3.60;
  9. double pikel = 19.80;
  10.  
  11. int alpineCount = Integer.parseInt(scanner.nextLine());
  12. int carabinerCount = Integer.parseInt(scanner.nextLine());
  13. int tireCount = Integer.parseInt(scanner.nextLine());
  14. int pikelCount = Integer.parseInt(scanner.nextLine());
  15.  
  16. int alpineSum = alpineCount + 1 - 1;
  17. int carabinerPrice = carabiner * carabinerCount;
  18. double tirePrice = tireCount * tire;
  19. double pikelPrice = pikelCount * pikel;
  20.  
  21. double singleAlpinePrice = carabinerPrice + tirePrice + pikelPrice;
  22. double allAlpinePrice = singleAlpinePrice * alpineSum;
  23. double taxPay = allAlpinePrice + (allAlpinePrice * 0.20);
  24.  
  25. System.out.printf("%.2f",taxPay);
  26.  
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement