Advertisement
RRPetrova

ExamPreparation_23.02.20_Sea

Feb 23rd, 2020
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.72 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Sea {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.  
  9.         double foodMoneyPerDay = Double.parseDouble(scanner.nextLine());
  10.         double souvenirsMoneyPerDay = Double.parseDouble(scanner.nextLine());
  11.         double hotelMoneyPerDay = Double.parseDouble(scanner.nextLine());
  12.  
  13.         double costsTransport = 7 * 210.0 / 100 * 1.85;
  14.  
  15.         double total = costsTransport * 2 + foodMoneyPerDay * 3 +
  16.                 souvenirsMoneyPerDay * 3 + hotelMoneyPerDay * 0.9 +
  17.                 hotelMoneyPerDay * 0.85 + hotelMoneyPerDay * 0.8;
  18.  
  19.         System.out.printf("Money needed: %.2f", total);
  20.  
  21.  
  22.  
  23.  
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement