Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.SQLOutput;
- import java.util.Scanner;
- public class DemoLive {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double budget=Double.parseDouble(scanner.nextLine());
- double priceHonorar=0;
- while (budget >= priceHonorar) {
- String input=scanner.nextLine();
- if (input.equals("ACTION")) {
- break;
- }
- double income = Double.parseDouble(scanner.nextLine());
- if (input.length() > 15) {
- priceHonorar = budget * 0.2;
- budget = budget - priceHonorar;
- double left = budget - priceHonorar;
- System.out.printf("We are left with %.2f leva.", left);
- break;
- }
- input=scanner.nextLine();
- }
- if (budget < priceHonorar) {
- double need=priceHonorar-budget;
- System.out.printf("We need %.2f leva for our actors.",need);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement