Advertisement
yovkovbpfps

Simple Operations Stadium Income

Apr 21st, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Stadium {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. int sectorsStadium = Integer.parseInt(scanner.nextLine());
  8. int capacityStadium = Integer.parseInt(scanner.nextLine());
  9. double oneTicketPrice = Double.parseDouble(scanner.nextLine());
  10.  
  11. double totalIncome = oneTicketPrice * capacityStadium;
  12. double count = sectorsStadium * capacityStadium;
  13. double oneSector = capacityStadium * oneTicketPrice / sectorsStadium;
  14. double charityMoney = (totalIncome - (oneSector * 0.75)) / 8;
  15.  
  16.  
  17. System.out.printf("Total income - %.2f BGN\n",totalIncome);
  18. System.out.printf("Money for charity - %.2f BGN",charityMoney);
  19.  
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement