Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Stadium {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int sectorsStadium = Integer.parseInt(scanner.nextLine());
- int capacityStadium = Integer.parseInt(scanner.nextLine());
- double oneTicketPrice = Double.parseDouble(scanner.nextLine());
- double totalIncome = oneTicketPrice * capacityStadium;
- double count = sectorsStadium * capacityStadium;
- double oneSector = capacityStadium * oneTicketPrice / sectorsStadium;
- double charityMoney = (totalIncome - (oneSector * 0.75)) / 8;
- System.out.printf("Total income - %.2f BGN\n",totalIncome);
- System.out.printf("Money for charity - %.2f BGN",charityMoney);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement