Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class AlpineEquipment {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int carabiner = 36;
- double tire = 3.60;
- double pikel = 19.80;
- int alpineCount = Integer.parseInt(scanner.nextLine());
- int carabinerCount = Integer.parseInt(scanner.nextLine());
- int tireCount = Integer.parseInt(scanner.nextLine());
- int pikelCount = Integer.parseInt(scanner.nextLine());
- int alpineSum = alpineCount + 1 - 1;
- int carabinerPrice = carabiner * carabinerCount;
- double tirePrice = tireCount * tire;
- double pikelPrice = pikelCount * pikel;
- double singleAlpinePrice = carabinerPrice + tirePrice + pikelPrice;
- double allAlpinePrice = singleAlpinePrice * alpineSum;
- double taxPay = allAlpinePrice + (allAlpinePrice * 0.20);
- System.out.printf("%.2f",taxPay);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement