Sleep debt calculator


#1

prompt ("How many hours do you sleep?");

function monday(){}
function tuesday(){}
function wenesday(){}
function thuersday(){}
function friday (){}
function saturday(){}
function sunday(){}
function getSleepHours(day){
var hours = prompt ("How many hours of sleep did you get on" +day + "?");
return Number(hours);
}

function getActualSleepHours(day){
function getSleepHours(day){
return getSleepHours('Monday')+
getSleepHours('Tuesday') +
getSleepHours('Wenesday')+
getSleepHours('Thuersday')+
getSleepHours('Friday')+
getSleepHours('Saturday')+
getSleepHours('Sunday');
}
}
function getIdealSleepHours(){
console.log(8);
prompt ('How much sleep is ideal per night?');
return Number(idealHours)*7;
}
function calculateSleepDebt(){
var actualSleepHours = getActualSleepHours;
var idealSleepHours = getIdealSleepHours;
if (actualSleepHours===idealSleepHours){
console.log('You got'(idealSleepHours===idealSleepHours)+ 'the perfect amout of sleep');
}
if (actualSleepHours<idealSleepHours){
console.log('You should get'+(idealSleepHours-actualSleepHours)+ 'some rest');
}
if(actualSleepHours>idealSleepHoues){
console.log('You got'+(idealSleepHours+acrualSleepHours)+'more sleep than needed');
console.log('Make sure to get some rest to be your best!'); }
}
I don't understand why isn't working.... :confused:


#2

console.log('You got'+(idealSleepHours+acrualSleepHours)+'more sleep than needed');

acrualSleepHours doesn't exist. Check your spelling.


#3

o thank you :slight_smile: