Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class WeddingParty {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int guestsCount = Integer.parseInt(scanner.nextLine());
- int budget = Integer.parseInt(scanner.nextLine());
- double allQuestsMoney = guestsCount * 20;
- if (budget >= allQuestsMoney){
- double leftMoney = (budget - allQuestsMoney);
- double fireworks = leftMoney * 0.4;
- System.out.printf("Yes! %.0f lv are for fireworks and %.0f lv are for donation", Math.abs(fireworks),Math.abs(leftMoney-fireworks ));
- }else {
- }
- System.out.printf("They won't have enough money to pay the covert. They will need %.0f lv more.",Math.abs(allQuestsMoney - budget));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement