process.stdin.resume()
process.stdin.setEncoding('utf8')
console.log("How old are you ? (between 0 and 99 years old)")
process.stdin.on('data', (yearsold) => {
if (yearsold > 99) {
console.log("Upper age limit exceeded")
process.exit()
}
else if (isNaN(yearsold)) {
console.log("How old are you ? (Please enter an arabic numeral)");
}
else if (age === undefined) {
console.log("Please enter an arabic numeral");
process.exit()
}
else {
let currentDate = whatisthedaytoday();
let birthYear = currentDate.year() - yearsold;
console.log(`Your birth year is ${birthYear}`);
process.exit()
}
})