Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class E01stadiumIncome {
- public static void main(String[] args){
- Scanner scanner = new Scanner(System.in);
- double sectors = Double.parseDouble(scanner.nextLine());
- double capacity = Double.parseDouble(scanner.nextLine());
- double ticketPrice = Double.parseDouble(scanner.nextLine());
- double totalIncome = (capacity * ticketPrice);
- double secotrsIncome = totalIncome/ sectors;
- double charityMoney = (totalIncome - (secotrsIncome * 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