Description
Purpose
• Programming using Arrays
• Programming using Objects
• Upload your website to a Web server
• This lab must be handed in:
Assessment
• This Lab is worth 2% of your total course mark.
Estimated Time
• This Lab is estimated to take 2 hours.
This is only an estimate of the time required to complete this Lab. I would encourage you to work at your own pace and if at all possible obtain a laptop so that you can work on your assignments from anywhere
The following chapters of ‘Fundamentals of Web Development’ will be useful in completing this Lab:
• Chapter 9
• Chapter 10
Lab Supplies
To complete this lab you will require the following lab supplies:
• Textbook: Fundamentals of Web Development
• EasyPHP, or other WAMP server
• Eclipse, Notepad (or other text editor, or IDE)
• FileZilla (or other FTP client)
Summary of Tasks
1. Develop the logic to display your web application
2. Upload your website to a webserver
3. View your webpage using a web browser
4. Submit Lab Link on Blackboard
5. Submit source code of all PHP files on Blackboard
Task 1
Before getting started with the following tasks, review the ‘Common Look and Feel’ video provided on Blackboard (under: Course Content → Extra Materials). Using the knowledge gained in these materials, implement the following Design Pattern to create a ‘Common Look and Feel’ to be used on every page of your website.
Your web site will include the following PHP scripts:
• Header.php
• Footer.php
• Menu.php
• Array.php
• Object.php
Header.php
Header.php must contain a script to display a Common Header that will appear on every page. The header must contain a banner (images, css, etc).
Footer.php
Footer.php must contain a script to display a Common Footer that will appear on every page. The footer must contain Student Number, First Name, Last Name, and Email Address
Menu.php
Menu.php must contain a script to display a Common Menu to be shown on every page. The menu must contain links to Array.php and Object.php
Array.php
Create a PHP script that will perform the following tasks.
2. Implement the array as follows:
1st 2nd 3rd 4th 5th
3 10 17 24 31
1st 2nd 3rd 4th
4 11 18 25
1st 2nd 3rd 4th
5 12 19 26
1st 2nd 3rd 4th
6 13 20 27
1st 2nd 3rd 4th
7 14 21 28
1st 2nd 3rd 4th
8 15 22 29
1st 2nd 3rd 4th
9 16 23 30
3. Place a header (h2) on the page with the following word ‘Output-1’. Use appropriate built-in function to display the contents of the array as key->value pair.
Sample output is as follows:
………
………… )
.
…………………………………….
……………………………..
5. Place a header (h2) on the page with the following word ‘Output-3’. Use appropriate built-in array function to display the contents of the array in reverse order.
6. Place a header (h2) on the page with the following word ‘Output-4’. Use appropriate built-in sort function to sort the array in reverse order and display the contents of the array.
8. Include common Header, Menu and Footer to the page.
Object.php
Create a PHP script that will perform the following tasks.
1. Define a class Vehicle which has protected properties: make, model, year, price. Create a constructor method that takes in make, model, year, and price. Implement a public method displayObject() to display the properties of each object instance.
4. Instantiate (Create) at least three objects of LandVehicle and display the properties of each object instance. Sample output is as follows:
Make:Toyota, Model:Camry,Year:1992, Price:2000, Speed Limit:180 Make:Honda, Model:Accord, Year:2002, Price:6000, Speed Limit:200
5. Instantiate (Create) at least three objects of WaterVehicle and display the properties of each object instance. Sample output is as follows:
Make:Mitsubishi, Model:Turbo, Year:1999, Price:20000, Boat Capacity:18 Make:Hyundai , Model:XT, Year:2012, Price:26000, Boat Capacity:8
6. Include common Header, Menu and Footer to the page.
Task 2
Upload your website to a Web server. Use an FTP client to connect to your Web server.
Once you connect to the webserver using an FTP client, create a directory called
‘/CST8238/Lab7’. Once your course directory has been created navigate to that new directory. Add your index.php file to this location. (Using FileZilla simply drag the index.php file into your folder). The index.php file will refer to all of your php files.
Task 3
View your website using a web browser. Open a web browser and navigate to the following web address: http://web-server_domain_name/CST8238/Lab7/<filename>
For example, the web address to my page is: http://profrejaul.com/CST8238/Lab7/index.php
Where ‘profrejaul.com’ is the domain name of the Web server, ‘ /CST8238/Lab7’ is the name of the directory I created in the Web server using FTP client and ‘index.php’ is the web page I created for this lab.
Task 4
Once you have confirmed that your webpage is available online, you are ready to hand in your lab.
To hand in your lab go to Blackboard and navigate to Course Content → Labs and click on ‘Lab 7 – Programming Arrays, Objects’ link.
Under “Assignment Materials”, in the Submission text box write out the following Information:
• Student Number
• First Name
• Last Name
• The URL, or hyperlink, prepared in Task 3
Under “Assignment Submission”, submit (attach) following PHP files:
• Header.php
• Footer.php
• Menu.php
• Array.php
• Object.php
Finally, once the Submission and Comments section are complete, click the ‘Submit’ button to send the lab to your professor.
IMPORTANT NOTE:
If the URL, or hyperlink, does not direct the professor to the lab you will receive a ZERO for the lab assignment.
IMPORTANT NOTE:
Reviews
There are no reviews yet.