Advertisement
Kur23

kur1

Apr 18th, 2021
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.86 KB | None | 0 0
  1. package PodgotovkaZaIzpit;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class AgencyProfit {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.  
  9.         String name = scanner.nextLine();
  10.         int adultTicketCount = Integer.parseInt(scanner.nextLine());
  11.         int kidTicketCount = Integer.parseInt(scanner.nextLine());
  12.         double adultPrice = Double.parseDouble(scanner.nextLine());
  13.         double servicePrice = Double.parseDouble(scanner.nextLine());
  14.  
  15.         double kidsPrice = adultPrice*0.3;
  16.  
  17.         double adultPriceWthSer = adultPrice + servicePrice;
  18.         double kidPriceWthSer = kidsPrice + servicePrice;
  19.  
  20.         double allSum = (adultPriceWthSer*adultTicketCount) + (kidPriceWthSer*kidTicketCount);
  21.  
  22.         double profit = allSum*0.2;
  23.  
  24.         System.out.printf("Izrechenie %.2f ", profit);
  25.  
  26.     }
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement