Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class ChangeBurea {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double budget = Double.parseDouble(scanner.nextLine());
- double leghtFloor = Double.parseDouble(scanner.nextLine());
- double weightFloor = Double.parseDouble(scanner.nextLine());
- double sideTriangle = Double.parseDouble(scanner.nextLine());
- double heightTriangle = Double.parseDouble(scanner.nextLine());
- double sumOneBath = Double.parseDouble(scanner.nextLine());
- double sumMaistor = Double.parseDouble(scanner.nextLine());
- double ploshtPod = leghtFloor * weightFloor;
- double ploshtPlochka = sideTriangle * heightTriangle / 2;
- double neededPlochki = Math.ceil(ploshtPod / ploshtPlochka) + 5;
- double finalSum = neededPlochki * sumOneBath + sumMaistor;
- double ostatuk = Math.abs(finalSum - budget);
- if (finalSum <= budget){
- System.out.printf("%.2f lv left.",ostatuk);
- } else {
- System.out.printf("You'll need %.2f lv more.",ostatuk);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement