Advertisement
dp0101

Hearthstone

Apr 26th, 2018
2,662
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.80 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Hearthstone {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner scanner = new Scanner(System.in);
  7.  
  8.         int breakTime = Integer.parseInt(scanner.nextLine());
  9.         double cardPricePerUnite = Double.parseDouble(scanner.nextLine());
  10.         double advPricePerUnite = Double.parseDouble(scanner.nextLine());
  11.         double coffeePricePerUnite = Double.parseDouble(scanner.nextLine());
  12.  
  13.        int totalBreak = breakTime - 15;
  14.        double moneyCard = 3.0* cardPricePerUnite;
  15.        double moneyAdventures = 2.0 * advPricePerUnite;
  16.  
  17.        double totalMoneySpend = moneyCard + moneyAdventures + coffeePricePerUnite;
  18.  
  19.        System.out.printf("%.2f%n", totalMoneySpend);
  20.        System.out.printf("%d", totalBreak);
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement