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