#These exercises cover: Control structures, IO streams, and functions.
- Exercise: if.php
- Using PHP boolean logic, I set conditionals that test for TRUE andFALSE.This helps me control how my code reacts during runtime.
- Exercise: if_and_or.php
- Using logical operators, I added comparison and logical operators to my if statements. Doing this has given me more options in my expressions.
- Exercise: while.php
- The 'While' loop option will execute my code as long as it meets the condition that I programmed within it. This is useful to me when I need my loops to continue until a condition I establish is met.
- Exercise: do_while.php
- A do-while loop will execute what i've listed within the 'do' statement first and then will check what is listed within the 'while' statement to determine if it should continue or die. This is used when you want your code to run once regardless.
- Exercise: fizzbuzz.php
- This program displays basic looping and conditional logic. Fizzbuzz prints numbers from 1 to 100. But for multiples of three prints “Fizz” instead of the number and for the multiples of five prints “Buzz”. For numbers which are multiples of both three and five “FizzBuzz” is displayed.
- Exercise:foreach.php
- A foreach loop makes it easy to iterate through arrays and objects. This exercise uses a foreach loop to iterate each value and output its type.
- Exercise: foreach_books.php
- This exercise presents a foreach loop that iterates through each book and then each book's keys and values. It outputs the book's title, then lists the key value pairs for the data about each book.
- Exercise: break_continue.php
- This exercise presents a for loop that shows all even numbers between 1-100 using continue, then creates another for loop that counts from 1-100, but stops after 10 using a break.
- Exercise: switch.php
- This exercise has introduced the switch statement to perform an action if none of the specific cases are met.
- Exercise: arithmetic.php
- This exercise presents functions that I defined to solve simple arithmetic problems as well as yield certain results based on input.
- Exercise: internal_functions.php
- This exercise utilizes built in php functions that solve simple commands.
- Exercise: search_arrays.php
- This exercise utilizes search arrays for queried values. My function returns a boolean value if an array value is found.
- Exercise: list_with_commas.php
- This exercise converts strings to arrays and arrays to string by using implode and explode functions.