Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Hearthstone {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int breakTime = Integer.parseInt(scanner.nextLine());
- double cardPricePerUnite = Double.parseDouble(scanner.nextLine());
- double advPricePerUnite = Double.parseDouble(scanner.nextLine());
- double coffeePricePerUnite = Double.parseDouble(scanner.nextLine());
- int totalBreak = breakTime - 15;
- double moneyCard = 3.0* cardPricePerUnite;
- double moneyAdventures = 2.0 * advPricePerUnite;
- double totalMoneySpend = moneyCard + moneyAdventures + coffeePricePerUnite;
- System.out.printf("%.2f%n", totalMoneySpend);
- System.out.printf("%d", totalBreak);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement