MladenKarachanov

Traininglab

Jan 13th, 2023
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.74 KB | None | 0 0
  1. package ProgrammingBasics2;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class TrainingLab {
  6.     public static void main(String[] args) {
  7.         Scanner scanner= new Scanner(System.in);
  8.         double lengthMeters = Double.parseDouble(scanner.nextLine());
  9.         double widthMeters = Double.parseDouble(scanner.nextLine());
  10.         double workPlace = 70*120;
  11.        // double corridor=100;
  12.         double lengthCentimeters = lengthMeters*100;
  13.         double widthCentimeters=widthMeters*100;
  14.         double corridor = 100;
  15.         double sumWidth= Math.floor((widthCentimeters-corridor)/70);
  16.         double sumLength =Math.floor(lengthCentimeters/120);
  17.         double sum=sumLength*sumWidth-3;
  18.  
  19.         System.out.printf("%.0f",sum);
  20.  
  21.     }
  22. }
  23.  
Add Comment
Please, Sign In to add comment