Using HTML and JavaScript, design and code a program which prompts a user for the year they were born, calculates the user’s age and displays the user’s age. If the user’s age is over 40 then set the background color of the web page to red. The solution must use the JavaScript Date object and use programmer created functions for calculating the user’s age.
What have you got so far? I usually write a type of outline of what needs to be done so I can get an idea of the logic I’ll need to use. eg.
prompt user for the year they were born
calculate the user’s age
display the user’s age
If the user’s age is over 40 then set the background color of the web page to red
*use the JavaScript Date object
*functions for calculating the user’s age.
The prompt is easy, you can find that by searching “javascript prompt”
Then search for “javascript date object”
Then search for “javascript background property”
After you research those you should be pretty well set if not completely done.