Tuesday, March 14, 2017

CST 336 Week 2

CST 336 Week 2

This week was all about PHP implementation in creating web pages. I learned how to use PHP variables and implement loops and conditions in PHP. I also learned the syntax of defining functions in PHP and generate randomization within PHP.
For the lab we had to generate a 10x10 table consisting of random numbers between 1 and 100. We were then tasked to color code all of the even and odd numbers differently. Finally the web page should count the number of even and odd numbers and display their corresponding percentages.
Here is a same of the web page:


Then for the next assignment we were tasked with creating our own idea to implement what we have learned this week. I decided to make a random BINGO card generator. It was fun and challenging trying to figure out how to go about solving this problem. In researching the problem I found that shuffling an array and then using array_pop() was the best way to randomize the numbers while also making sure not to use them twice. Here is an example of the program output.

No comments:

Post a Comment