Generation

generate functionThu, 11 May 2023

Write a function that takes in a number of hours, minutes, and seconds, counts down in real time, and returns "FInish!" at the end. If a person enters in seconds or minutes, greater than 60, or hours greater than 99, It should return "Invalid Seconds","Invalid Minutes", or "Invalid Hours",

function countDown(hours, minutes, seconds) { var hours = hours * 3600; var minutes = minutes * 60; var totalSeconds = seconds + minutes + hours; while (totalSeconds > 0) { process.stdout.write('\033c'); console.log(totalSeconds); totalSeconds--; } return 'Finish'; }

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant