Challenge 1 Programming Problems:
Problem 1: Write a program that uses 10 different
variables to store data: text/numbers. Print the value of
each variable to the window. Then modify each variable, without
reinitializing, and display the variables. Use basic HTML
within the program to make the output look nice. Include comments.
Problem 2: Write a program that iterates through the
contents of an array using a while loop, then a for loop with
a different array. 2 loops, 2 different arrays. Each array
must have at least 5 elements. Inside the loops, have multiple
if statements to print (echo) out statements depending on
the value of each array element. Use basic HTML within the
program to make the output look nice. Include comments.
Problem 3: Write a phone book program. This program
should use an associative array to store the phone numbers
of your favorite restaurants, stores, friends, etc. Refer
to the "free2code.net"supplemental reading for information
on associative arrays. You do not have to provide real names/numbers
for your friends if you don't want. The structure of the associative
array should be: 'name' => 'phone number'; You must have
at least 20 elements in your associative array. Display the
contents of your phone book associative array. Use basic HTML
within the program to make the output look nice. Include comments.
Problem 4: Write a program that sums and multiplies
all the odd numbers from 1 to 1000, inclusive. You must use
only ONE loop. Display the values of your addition and mutliplication.
Use basic HTML within the program to make the output look
nice. Include comments.
Problem 5: Write a program that manipulates an array
using the various array functions. Start the program with
an empty array - no values. Use push, pop, shift, and count.
First, push 25 items onto the array - it can be numbers, text,
whatever you want. Print out the contents of the array using
a loop. Second, pop off the last 5 elements of the array.
Print the array using a different type of loop. Third, use
shift to remove the first 5 elements. Print the array. Finally,
use count to determine the final size of the array and print
it. Include comment