Advertisement
Valeri12580

Stadium Income

Jan 18th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Exercise1 {
  4. public static void main(String[] args) {
  5. Scanner scanner=new Scanner(System.in);
  6. int numSectors=Integer.parseInt(scanner.nextLine());
  7. int capacity=Integer.parseInt(scanner.nextLine());
  8. double priceBilet=Double.parseDouble(scanner.nextLine());
  9.  
  10. double pechalbaEdinSektor=(capacity*priceBilet)/numSectors;
  11. double obshtaPechalba=capacity*priceBilet;
  12. double priceBlagotvoritelnost=(obshtaPechalba-(pechalbaEdinSektor*0.75))/8;
  13.  
  14. System.out.printf("Total income - %.2f BGN%n",obshtaPechalba);
  15. System.out.printf("Money for charity - %.2f BGN",priceBlagotvoritelnost);
  16.  
  17.  
  18.  
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement