1) Link to an external JavaScript file and an external CSS file. 2) Create a prompt that asks the user to input their age. 3) Based on the userʼs input, evaluate if the user is old enough to retire...


1) Link to an external JavaScript file and an external CSS file.


2) Create a prompt that asks the user to input their age.


3) Based on the userʼs input, evaluate if the user is old enough to retire (65), and/or drive (16), and/or vote (21). Note that the user may be able to do more than one of these things listed, such as vote and drive (but if they're less than 16, they can't doanyof those things!). You will likely need to use the keywords:if,else
if, andelse.


4) Test for non-numeric user input. Display an appropriate message in that case, for example: "
Aardvarkis not a valid age — please try again".


I will give you a hint here: This part is covered in the excellent reading from Eloquent Javascript.


5) Output the result of any decision using thedocument.writemethod.
You may use thedocument.getElementByIdmethod if you want to work ahead a little - your choice. Your output should be something along the lines of: "You are old enough to vote and drive" or "You are not old enough to vote but you can drive", among other possible outputs. If not sure about what to display, please ask.


6) Use a style for the output. At the least please format the text size, font style, and color of the text. You can be more elaborate with the style if you like.

May 19, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here