Advertisement
SotirovG

TrainingLab_05

Sep 13th, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.02 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class TrainingLab_05 {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         // създаваме си променливите за 4етене : 2 4исла
  7.         // да се отпе4атат броят места в у4ебната зала
  8.         // ограни4ение 3 <= h <= w <= 100
  9.         // декларирам коридора който е 100 см широк ??
  10.  
  11.         int floor = 100;
  12.         double deskWide = 70;
  13.         double line = 120;
  14.  
  15.         double longInMeters = Double.parseDouble(scanner.nextLine());
  16.         double wideInMeters = Double.parseDouble(scanner.nextLine());
  17.  
  18.         double longInCm = longInMeters * 100 ;
  19.         double wideInCm = ( wideInMeters * 100 ) - floor;
  20.  
  21.         double numOfDesk = wideInCm / deskWide ;
  22.         double numOfLine = longInCm / line;
  23.         double totalSeat = ( numOfDesk * numOfLine) - 3;
  24.         System.out.println( totalSeat );
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.     }
  33. }
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement