Ligh7_of_H3av3n

03. Final Competition

Oct 15th, 2023
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.59 KB | None | 0 0
  1. package SamiqtIzpit;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class P03 {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.  
  9.         int dancers = Integer.parseInt(scanner.nextLine());
  10.         double score = Double.parseDouble(scanner.nextLine());
  11.         String season = scanner.nextLine();
  12.         String place = scanner.nextLine();
  13.  
  14.         double totalscore = 0.00;
  15.         double score1 = 0.00;
  16.  
  17.         if (place.equals("Bulgaria"))
  18.         {
  19.             totalscore = score * dancers;
  20.             if (season.equals("summer"))
  21.             {
  22.                 score1 = totalscore * 0.95;
  23.             }
  24.             else if (season.equals("winter"))
  25.             {
  26.                 score1 = totalscore * 0.92;
  27.             }
  28.             double charity = score1 * 0.75;
  29.             double leftMoney = (score1 - charity) / dancers;
  30.  
  31.             System.out.printf("Charity - %.2f\n", charity);
  32.             System.out.printf("Money per dancer - %.2f", leftMoney);
  33.         }
  34.  
  35.         else if (place.equals("Abroad")) {
  36.             totalscore = score * dancers * 1.5;
  37.             if (season.equals("summer"))
  38.             {
  39.                 score1 = totalscore * 0.9;
  40.             }
  41.             else if (season.equals("winter"))
  42.             {
  43.                 score1 = totalscore * 0.85;
  44.             }
  45.             double charity = score1 * 0.75;
  46.             double leftMoney = (score1 - charity) / dancers;
  47.  
  48.             System.out.printf("Charity - %.2f\n", charity);
  49.             System.out.printf("Money per dancer - %.2f", leftMoney);
  50.         }
  51.     }
  52. }
  53.  
Add Comment
Please, Sign In to add comment