Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Demos;
- import java.time.LocalDate;
- import java.time.format.DateTimeFormatter;
- import java.util.Scanner;
- public class DemoClass {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- int timeToRest = Integer.parseInt(scan.nextLine());
- double packPrice = Double.parseDouble(scan.nextLine());
- double adventurePrice = Double.parseDouble(scan.nextLine());
- double coffeePrice = Double.parseDouble(scan.nextLine());
- double timeLeft = timeToRest - (5 + (3 * 2) + (2 * 2));
- double moneySpent = 3 * packPrice + 2 * adventurePrice + coffeePrice;
- System.out.printf("%.2f%n", moneySpent);
- System.out.printf("%.0f", timeLeft);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement