finderabc

live demo

Jun 11th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.83 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class LiveDemo {
  4.     public static void main(String[] args) {
  5.  
  6.         Scanner scanner = new Scanner(System.in);
  7.  
  8.         double moneyFood = Double.parseDouble(scanner.nextLine());
  9.         double moneySouvenirs = Double.parseDouble(scanner.nextLine());
  10.         double moneyHotel = Double.parseDouble(scanner.nextLine());
  11.  
  12.         int distance = 210;
  13.         int timeDays = 3;
  14.  
  15.         int spendKilometers = 7 / 100;
  16.         double pricePerKilometer = 1.85;
  17.  
  18.         double allPriceForHotel = Double.parseDouble(scanner.nextLine());
  19.  
  20.         double firstDay = allPriceForHotel * 0.10;
  21.         double secondDay = allPriceForHotel * 0.15;
  22.         double thirdDay = allPriceForHotel * 0.20;
  23.  
  24.         System.out.printf("Money needed: %.2f %f", allPriceForHotel);
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.     }
  33. }
Add Comment
Please, Sign In to add comment