SHARE
TWEET

Simple Operations Trekking Equipement

yovkovbpfps Apr 20th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top