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