Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. import java.sql.SQLOutput;
  2. import java.util.Scanner;
  3.  
  4. public class DemoLive {
  5. public static void main(String[] args) {
  6. Scanner scanner = new Scanner(System.in);
  7.  
  8. double budget=Double.parseDouble(scanner.nextLine());
  9.  
  10. double priceHonorar=0;
  11. while (budget >= priceHonorar) {
  12. String input=scanner.nextLine();
  13. if (input.equals("ACTION")) {
  14. break;
  15. }
  16. double income = Double.parseDouble(scanner.nextLine());
  17.  
  18. if (input.length() > 15) {
  19. priceHonorar = budget * 0.2;
  20. budget = budget - priceHonorar;
  21. double left = budget - priceHonorar;
  22. System.out.printf("We are left with %.2f leva.", left);
  23. break;
  24. }
  25. input=scanner.nextLine();
  26. }
  27.  
  28. if (budget < priceHonorar) {
  29. double need=priceHonorar-budget;
  30. System.out.printf("We need %.2f leva for our actors.",need);
  31. }
  32.  
  33.  
  34.  
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement