Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function movieDay(input) {
- let timeForPhotos = Number(input[0]);
- let scenesCount = Number(input[1]);
- let sceneDuration = Number(input[2]);
- let fieldPreparation = timeForPhotos * 0.15;
- let timeScenes = scenesCount * sceneDuration;
- let totalTime = fieldPreparation + timeScenes;
- if (timeForPhotos >= totalTime) {
- console.log(`You managed to finish the movie on time! You have ${(Math.abs)(totalTime - timeForPhotos)} minutes left!`);
- } else {
- console.log(`Time is up! To complete the movie you need ${(Math.abs)(timeForPhotos - totalTime)} minutes.`);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement