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