Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class RepairigTheTiles {
- public static void main(String[] args) {
- Scanner console = new Scanner(System.in);
- int floorSide = Integer.parseInt(console.nextLine());
- double tileWidth = Double.parseDouble(console.nextLine());
- double tileLength = Double.parseDouble(console.nextLine());
- double benchWidth = Double.parseDouble(console.nextLine());
- double benchLength = Double.parseDouble(console.nextLine());
- double plazaArea = floorSide * floorSide;
- double areaForTiles = plazaArea - (benchLength * benchWidth);
- double numberOfTiles = Math.ceil(areaForTiles/(tileLength * tileWidth));
- double timeForPlaza =Math.floor( 0.20 * numberOfTiles);
- System.out.printf("%s\n",(int)numberOfTiles);
- System.out.printf("%s",(int)timeForPlaza);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment