Lab 13 - It 130

  1. Create a directory named lab13 at your students account and locally.
  2. Type the code in. Run it several times and study the code.
  3. <html> <title>Loop 1 example</title> <body> <script> var i = 1; while(i <= 10){ document.write("Welcome to my page" + "<br />"); ++i; } </script> </body> </html>
  4. Type the code in. Run it several times and study the code.
  5. <html> <title>Loop 2 example</title> <body> <script> var count = 1; document.write("Counting to 10 <br />"); while(count <= 10){ document.write(count + "<br />"); count = count + 1; } </script> </body> </html>
  6. Study loop example 2. write a program similar to loop example 2 that outputs
  7. 10
    9
    8
    7
    6
    5
    4
    3
    2
    1
    Blast off
    
  8. Run and study the code doubles.html. Modify the program so it counts how many times it takes to get doubles and outputs the results. For example one possible outcome would be. You rolled: 4 5 You rolled: 5 3 You rolled: 5 4 You rolled: 2 1 You rolled: 6 3 You rolled: 3 5 You rolled: 1 3 You rolled: 2 2 DOUBLES It took 8 rolls to get doubles

    You would add the code to write the statement

    It took 8 rolls to get doubles
    
  9. Modify dicestats so it also keeps track of the number of 11's rolled.
  10. Work on your project