BubaLazi

p01_RepairingTheTiles40/100

Mar 17th, 2017
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.88 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class RepairigTheTiles {
  4.     public static void main(String[] args) {
  5.         Scanner console = new Scanner(System.in);
  6.  
  7.  
  8.         int floorSide = Integer.parseInt(console.nextLine());
  9.         double tileWidth = Double.parseDouble(console.nextLine());
  10.         double tileLength = Double.parseDouble(console.nextLine());
  11.         double benchWidth = Double.parseDouble(console.nextLine());
  12.         double benchLength = Double.parseDouble(console.nextLine());
  13.  
  14.         double plazaArea = floorSide * floorSide;
  15.         double areaForTiles = plazaArea - (benchLength * benchWidth);
  16.  
  17.         double numberOfTiles = Math.ceil(areaForTiles/(tileLength * tileWidth));
  18.  
  19.         double timeForPlaza =Math.floor( 0.20 * numberOfTiles);
  20.  
  21.         System.out.printf("%s\n",(int)numberOfTiles);
  22.         System.out.printf("%s",(int)timeForPlaza);
  23.  
  24.     }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment