galinyotsev123

ProgBasicsExam28and29July2018-E01stadiumIncome

Dec 28th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class E01stadiumIncome {
  4. public static void main(String[] args){
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. double sectors = Double.parseDouble(scanner.nextLine());
  8. double capacity = Double.parseDouble(scanner.nextLine());
  9. double ticketPrice = Double.parseDouble(scanner.nextLine());
  10.  
  11. double totalIncome = (capacity * ticketPrice);
  12. double secotrsIncome = totalIncome/ sectors;
  13. double charityMoney = (totalIncome - (secotrsIncome * 0.75)) /8 ;
  14.  
  15. System.out.printf("Total income - %.2f BGN%n", totalIncome);
  16. System.out.printf("Money for charity - %.2f BGN", charityMoney);
  17.  
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment