Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. process.stdin.resume()
  2. process.stdin.setEncoding('utf8')
  3. let year=2019
  4.  
  5. console.log('What\'s your age ? ')
  6. process.stdin.on('data', (customerAge) => {
  7. if(customerAge>0 && customerAge<99){
  8. console.log('You\'re born in '+(year - customerAge))
  9. process.exit()
  10. }else{
  11. console.log('Youre age must be betwin 1 and 99 ')
  12. }
  13. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement