<h1>JavaScript Practice</h1>
    <h2> Your Age </h2>

    <p id="results"></p>

    <script>

        // Prompt the user for their year of birth
        var birthYear = parseInt(prompt("What year were you born?", "2000"));

        // Using this information, calculate their age
        var age = 2016 - birthYear;

        // Format messages
        var message1 = "You must be " + age + " or " + (age-1) + " years old.";
        var message2 = "";
        
        // Check if they can vote
        if (age >= 18) {
          message2 = "You are old enough to vote.";
        }
        
        // For alert or console.log(), a new line character will print a new line in the display
        alert(message1 + "\n" + message2);
        console.log(message1 + "\n" + message2);
        
         // Calculate their retirement age
        var retireYear = birthYear + 62;
        
        //format the messages
        var message3 = "You may retire in " + retireYear;
        var message4 = retireYear + " is a long time from now!";

        // Present the results
        alert(message3);
        alert(message4);
        
       
        //And add these results to the page

        // To print the message on the page, use document.getElementById and the 
tag to // print one message on each line document.getElementById("results").innerHTML = message1 + "
" + message2 + + "

" +message3 + "
" + message4; </script>