Advertisement
Guest User

01. Hearthstone JAVA

a guest
Mar 12th, 2018
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.89 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Main {
  6.  
  7.     public static void main(String[] args) {
  8.         Scanner sc = new Scanner(System.in);
  9.         int timeOFrest = Integer.valueOf(sc.nextLine());
  10.         double priceOFcards = Double.valueOf(sc.nextLine());
  11.         double priceOFadventure = Double.valueOf(sc.nextLine());
  12.         double priceOFcoffe = Double.valueOf(sc.nextLine());
  13.         double pauseOFcoffe = timeOFrest - 5;
  14.         double remainTimeOFday = 6;
  15.         double timeOFbuyAdventure = 4;
  16.         double freeTime = pauseOFcoffe - (remainTimeOFday+timeOFbuyAdventure);
  17.         double moneyFORcards = priceOFcards*3;
  18.         double moneyFORadventure = priceOFadventure*2;
  19.         double allmoneyFORbuy = moneyFORcards+moneyFORadventure+priceOFcoffe;
  20.         System.out.printf("%.2f\n",allmoneyFORbuy);
  21.         System.out.printf("%.0f",freeTime);
  22.  
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement