Advertisement
Guest User

Untitled

a guest
May 20th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.74 KB | None | 0 0
  1. package Demos;
  2.  
  3. import java.time.LocalDate;
  4. import java.time.format.DateTimeFormatter;
  5. import java.util.Scanner;
  6.  
  7. public class DemoClass {
  8.     public static void main(String[] args) {
  9.         Scanner scan = new Scanner(System.in);
  10.  
  11.         int timeToRest = Integer.parseInt(scan.nextLine());
  12.         double packPrice = Double.parseDouble(scan.nextLine());
  13.         double adventurePrice = Double.parseDouble(scan.nextLine());
  14.         double coffeePrice = Double.parseDouble(scan.nextLine());
  15.  
  16.         double timeLeft = timeToRest - (5 + (3 * 2) + (2 * 2));
  17.         double moneySpent =  3 * packPrice + 2 * adventurePrice + coffeePrice;
  18.  
  19.         System.out.printf("%.2f%n", moneySpent);
  20.         System.out.printf("%.0f", timeLeft);
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement