Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package SamiqtIzpit;
- import java.util.Scanner;
- public class P03 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int dancers = Integer.parseInt(scanner.nextLine());
- double score = Double.parseDouble(scanner.nextLine());
- String season = scanner.nextLine();
- String place = scanner.nextLine();
- double totalscore = 0.00;
- double score1 = 0.00;
- if (place.equals("Bulgaria"))
- {
- totalscore = score * dancers;
- if (season.equals("summer"))
- {
- score1 = totalscore * 0.95;
- }
- else if (season.equals("winter"))
- {
- score1 = totalscore * 0.92;
- }
- double charity = score1 * 0.75;
- double leftMoney = (score1 - charity) / dancers;
- System.out.printf("Charity - %.2f\n", charity);
- System.out.printf("Money per dancer - %.2f", leftMoney);
- }
- else if (place.equals("Abroad")) {
- totalscore = score * dancers * 1.5;
- if (season.equals("summer"))
- {
- score1 = totalscore * 0.9;
- }
- else if (season.equals("winter"))
- {
- score1 = totalscore * 0.85;
- }
- double charity = score1 * 0.75;
- double leftMoney = (score1 - charity) / dancers;
- System.out.printf("Charity - %.2f\n", charity);
- System.out.printf("Money per dancer - %.2f", leftMoney);
- }
- }
- }
Add Comment
Please, Sign In to add comment