Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve([widthHole, heightHole, pictureSide, pictureCount]) {
- widthHole = Number(widthHole);
- heightHole = Number(heightHole);
- pictureSide = Number(pictureSide);
- pictureCount = Number(pictureCount);
- //Sizes of Hole and Picture
- let wallArea = widthHole * heightHole;
- let pictureArea = pictureSide * pictureSide;
- let pictureSize = pictureArea * pictureCount;
- if (wallArea > pictureSize) {
- console.log("The pictures fit in the hole." + " Hole area is " + (wallArea - pictureSize) + " bigger than pictures area.");
- console.log();
- } else if (pictureSize > wallArea) {
- console.log("The pictures don't fit in the hole." + " Picture area is " + (pictureSize - wallArea) + " bigger than hole area.");
- }
- }
- // solve([10, 5, 2, 3]);
- // solve([16, 13, 12, 5]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement