Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class demo {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int dancers = Integer.parseInt(scanner.nextLine());
- double points = Double.parseDouble(scanner.nextLine());
- String season = scanner.nextLine();
- String location = scanner.nextLine();
- double money = 0;
- if(location.equals("Bulgaria")){
- money = dancers * points;
- }else{
- money = dancers * points * 1.5;
- }
- if(season.equals("summer")){
- if(location.equals("Bulgaria")){
- money = money - money * 0.05;
- }else{
- money = money - money * 0.1;
- }
- }else{
- if(location.equals("Bulgaria")){
- money = money - money * 0.08;
- }else{
- money = money - money * 0.15;
- }
- }
- double moneyForDonation = money * 0.75;
- double moneyLeft = money - moneyForDonation;
- double moneyPerDancer = moneyLeft / dancers;
- System.out.printf("Charity - %.2f\nMoney per dancer - %.2f\n", moneyForDonation, moneyPerDancer);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement