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