Advertisement
Spocoman

Sea Trip

Sep 9th, 2024
516
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.73 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         double dayFoodPrice = Double.parseDouble(scanner.nextLine()),
  7.                 daySouvenirPrice = Double.parseDouble(scanner.nextLine()),
  8.                 dayHotelPrice = Double.parseDouble(scanner.nextLine()),
  9.                 foodPrice = dayFoodPrice * 3,
  10.                 souvenirPrice = daySouvenirPrice * 3,
  11.                 hotelPrice = dayHotelPrice * 0.90 + dayHotelPrice * 0.85 + dayHotelPrice * 0.80,
  12.                 transportPrice = 210.0 * 2 / 100 * 7 * 1.85;
  13.  
  14.         System.out.printf("Money needed: %.2f\n", foodPrice + souvenirPrice + hotelPrice + transportPrice);
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement