Lab One - due 10/24/09
**************************************************************
Lab Two - due 11/14/09
1. Create a string of names consisting of "John, Jerry, Ann, Sanji, Wen, Paul, Louise, Peter".
2. Create a multidimensional array of movies organized by genre. This should take the form of an associative array with genres as keys, such as Musical, Action, Adventure, and so forth. Each of the array’s elements should be an array containing movie names, such as Passion of Christ, Star Wars, Chariots of Fire, and so on. When your arrays are created, loop through them, printing the name of each genre and its associated movie(s). Sort your array.
3. Create a feedback form that accepts a user’s full name in one textbox (indicate a message that the user must enter his/her first name first, then last name), state abbreviation where he/she lives (such as CA, NY, etc.), an email address, and the month, day and year of his/her birthday. Use case conversion functions to capitalize the first letter of each name the user submits. Check that the user’s email address contains the @ symbol and print a warning otherwise. If the user did not input a state abbreviation, assign a default value of “CA.” Generate an error message if user did not input full name, email address or birthday.
4. Create a Song Organizer script that stores songs in a text file. Print a summary that includes the number of lines in the file and the file's size. Append another song in the text file. Include functionality that allows users to view the song lists and prevents the same song name from being entered twice. Also, include code that sorts the songs by name and randomizes the song list with the shuffle( ) function.
5. Create a PHP script which takes two parameters: (1) the number of years and (2) the amount of money to be put on a savings account. Include a function that calculates the amount that will have been reached after a given number of years. Print the amount with no more than two decimals. Come up with your own interest rate.
6. Remove the last two chunks of values from the following array: $array = array("Zero"=>"PHP", "One"=>"Perl", "Two"=>"Java");
Output the removed chunks, which are [One] => Perl and [Two] => Java,
and the remaining chunk, which is [Zero] => PHP
7. Given the following array: $date = array('01', '01', '2006'); $keys = array('php', 'string', 'function'); Generate an output such as:
A formated date: 01/01/2006
A keyword list: php, string, function
8. Create an array with a sequence of integers or characters. Do not use a loop. Please check: http://www.w3schools.com/PHP/func_array_range.asp
9. Given the following array: $array = array("Zero"=>"PHP", "One"=>"Perl", "Two"=>"Java"); Generate an output such as: This script will print: Padded: ---,---,PHP,Perl,Java,>>,>>,>>
10. Pass an array of numbers into a function and output the average number in the array of numbers.
11. Demonstrate how to return an array of random numbers from a function.
12. Demonstrate how to define an array argument as a reference type.
13. Demonstrate how an array is passed through an argument by value
14. Create a text file and read the entire file into a single string.
15. Create a text file and read the file one character at a time
16. Create a text file with multiple lines and read those lines into an array.
17. Create a text file with multiple lines, and read those lines one line at a time.
**************************************************************
Lab Three - due 11/30/09
1. Create a demographics database with a table that contains the following fields: country, primary language, and population. Enter records for at least 10 countries. You can find demographic information for various countries in many places on the Internet. Write queries that return the following:
a. A list of all records sorted by country name
b. The country with the highest population
c. The country with the lowest population
d. Countries that share a common language, such as French
2. Create a database for a used car dealership that includes a table for inventory. Include the following fields in the inventory table: make, model, price and mpg (miles per gallon). Enter at least 10 records into the table. Write queries that return the following:
a. All records
b. Make, model, and price, sorted by make and model
c. The make and model of the car that gets the best miles per gallon
d. The make and model of the car that gets the worst miles per gallon.
e. The make and model of the highest and lowest priced cars
3. Create a Web page to be used for storing software development bug reports in a MySQL database. Include fields such as product name and version, type of hardware, operating system, frequency of occurrence, and proposed solutions. Include links on the main page that allows you to create a new bug report and update on existing bug report.
4. Create a Web page that stores airline surveys in a MySQL database. Include fields for date and time of the flight, flight number, and so on. Also, include groups of radio buttons that allow the user to rate the airline on the following criteria:
a. Friendliness of customer staff
b. Space for luggage storage
c. Comfort of seating
d. Cleanliness of aircraft
e. Noise level of aircraft
The radio buttons for each question should consist of the following options: No Opinion, Poor, Fair, Good, or Excellent. Store all the records in a MySQL table. Include a View Past Survey Results button on the main survey page that displays a list of past survey results.