Thursday, January 19, 2017
Lab 8 Reflection Journal
For lab 8 I had to show demonstrations of the 4 different types of loops which we learned about. The types of loops are the for loop, the for/in loop, the do/while loop and the whole loop. So I first created an HTML document and I put in 3 headings which contained the lab number, my name and the date and the course. I then created a table in which I organized it by putting the type of loop and next to it is a button in which when you click on it, it demonstrates that kind of loop. I linked the external CSS style sheet to the HTML document. I had to use an onclick event handler and the demonstration I put for the for loop is a loop which lists the even numbers up to 16. For the for/in loop demonstration, I put a loop which asks the user for their favorite color, name and age and it writes it out on the HTML document. I made a loop that asked the user for a number, decimal and symbol and write it out for the while loop demonstration. For the do/while loop demonstration, I have a loop that writes numbers from 4-7. This lab is useful and will be used in future labs and projects because it's much more convenient using loops rather than putting the same code over for several times.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment