[Year 12 SofDev] PHP text available soon !!!

Howard, David dhoward at stmichaels.vic.edu.au
Mon Jan 24 17:42:12 EST 2011


Hi Kevork,

How much $$$ and how do we order?

David
________________________________________
From: sofdev-bounces at edulists.com.au [sofdev-bounces at edulists.com.au] On Behalf Of Kevork Krozian [kevork at edulists.com.au]
Sent: Monday, 24 January 2011 5:25 PM
To: 'Year 12 Software Development Teachers' Mailing List'
Subject: Re: [Year 12 SofDev] PHP text available soon !!!

Hi Robert,

 Yes, I intended to attach a table of contents.......  You can find it here http://www.edulists.com.au/products/Table%20of%20Contents%20PHP_2011_v1.2%20-%20.pdf  or here it is:
PHP programming with OOP and data visualization for Software Development[cid:image001.png at 01CBBBEB.B24B9E80]

Introduction.. 4

What is in this publication ?. 4

Why produce this publication ?. 5

How is this manual going to help me and my students ?. 5

What this manual contains. 6

Why PHP and which version ?. 6

Xampp.. 7

Web server. 7

Xampp Installation. 7

Server2Go.. 13

Learning Activities.. 16

Tasks and Level of Difficulty. 18

Introduction. 19

Anatomy of a web page. 19

Html code. 20

PHP code. 21

How PHP runs in a html page. 22

Sample page using html and PHP. 22

Exercise 1. 25

Special characters and how to display them... 25

Cascading Style Sheets. 26

How to insert a table. 26

Exercise 2. 28

Using variables in a PHP page. 28

Numeric variables. 28

Calculations. 29

String variables. 30

Working with Strings. 31

Exercise 3. 35

Using programming structures – branching and looping. 35

Using the If statement 35

Using the Switch statements. 36

Using the While loop. 36

Using the For loop. 38

Exercise 4. 39

Accessing System information. 39

Access client information. 40

Using the include a File statement 40

Exercise 5. 42

Using Arrays. 42

Working with Arrays. 43

Move, add, remove, replace elements of an array. 44

Sort elements of an array. 45

Associative arrays. 45

Exercise 6. 47

Using Functions. 47

Understanding variable scope. 48

Parameter passing by value. 50

Parameter passing by reference. 51

Exercise 7. 53

Data Structures in PHP. 53

Using 2 dimensional arrays. 54

Working with queues. 58

Implementing stacks. 59

Exercise 8. 63

Using Forms. 63

Create a Form... 65

Add elements to a Form... 66

Process a Form... 68

Validate elements of a Form... 69

PHP Validation statements. 69

Exercise 9. 71

Using files to save data. 71

Write to a file. 71

Read from a file. 72

Exercise 10. 74

Saving to Files on Web servers – an introduction. 74

Using Files. 74

Format output from retrieved data. 76

Sorting Output from retrieved data. 77

A php page calling itself. 81

How to cast a variable (change its type) 83

Exercise 11. 85

Add data to a file. 88

Editing data in a file. 90

Delete data in file. 93

Exercise 12. 95

Introduction to Object Oriented Programming. 95

Records in PHP. 96

Exercise 13. 99

Constructors and Destructors. 99

Parent class, child class and inheritance. 102

Design A – use of separate files for each class to write/read. 104

Design B – use of one file for all classes to write/read. 110

Public, Private and Protected property or method -visibility. 122

Useful Diagnostic Class Functions. 125

Exercise 14. 128

An introduction to data visualization. 128

Functions Required. 129

Graphical representation of data. 131

Bar Graph. 131

Exercise 15. 136

Security  - password protection of files. 136

Session variables. 138

Use of pop up login box for authentication. 140

Exercise 16. 144

Scenario -  Restaurant Ordering System... 144

The PHP Code  -  Restaurant Ordering System... 152

Exercise 17. 167

UML and Use Case Essentials. 167

Restaurant Case Study - Design Retrospective. 175

Use Case. 175

SRS – background and outline. 177

Restaurant Case Study - Design Retrospective. 179

SRS - Software Requirements Specifications. 179

Exercise 18. 185

Mobile devices and PHP. 185

Customise output based on client environment using PHP. 191

Case Study - Mobile Utility Sales. 199

Exercise 19. 203

Debugging hints and tips. 203

Debugging Worked example Exercise 14. 207

Assessment Task 1. 214

Scenario 1. 214

Scenario 2. 215

Scenario 3. 215

Assessment Task 2. 216

Scenario 1. 216

Scenario 2. 216

Scenario 3. 216

Glossary.. 217


In addition here is a sample worksheet from a random chapter ( Chapter 7 ) :
1.      Create a two dimensional array, each row of 5 elements describing a student’s details ( name, surname, age, gender, hobby, mobile number)  using each of
a.       PHP code that uses the $myarray[] declaration to add items progressively
b.      PHP code that uses the  $myarray[0][0] index type of explicit declaration to progressively add each student’s details

Print the results using each of:

a.       the print_r() function

b.      a nested loop to print a table of data using CSS for improved formatting
.
2.      Using the data in the roadside service example earlier in this exercise declare an array to hold all the values

Name

Surname

Vehicle Registration number

Time of Call

Problem

Service
complete?

Head of Queue


Peter

Harris

SBN034

9:23 am

Flat battery

Yes

[cid:image002.png at 01CBBBEB.B24B9E80]Jenny

Dong

UTM155

9:56 am

Flat tyre

No

Stefan

Crech

TYO333

10:01 am

Car not starting

No

Georgia

Karashvilli

RBU699

10:17 am

Engine overheated

No

Karim

Abdul

ETN210

10:39 am

Keys locked in car

No

[cid:image003.png at 01CBBBEB.B24B9E80]
Tail of Queue


Jose

Ramirez

TYP229

10:45 am

Car not starting

No


                        Add code to:

a)      Locate the head of the Queue based on time of call and service not yet complete ( assume as shown times are already ordered from earliest to latest)

b)      Locate the tail of the Queue

c)       Print only the Queue identifying the head and tail of the queue

3.      Using the syntax for function declarations in Exercises 6 and 7 write a short PHP script to calculate the factorial function for a given value using recursion and the concept of a stack.

4.      For the following examples explain if a FIFO ( Queue ) or a LIFO (Stack) data structure is the best fit :

a.       A sequence of print jobs are sent to a print server where the jobs are printed in the order in which they are received. If a printer is busy the jobs are stored awaiting the printer.

b.      When a person wears bangles the last bangle worn is the first one to be removed and the first bangle would be the last to be removed.

c.       In a stack of plates, one can take out the plate from top or can add a plate to the top. The plate that was placed first would be the last to take out.

d.      A call centre at a bank answers calls at a bank in the order they are received. If there are more calls available staff customers listen to promotional music awaiting the next staff member.

e.       Batteries in the flashlight batteries are removed so that the last one added is the first one removed and the first added is the last one removed. So the battery that was put in first would be the last one to take out.

f.       Patients arrive at a bank to see a teller. They take a ticket from a self service machine. They then wait until their number is announced after which they can approach the teller allocated.

g.      Cars in a garage In order to take out the car that was parked first you need to take out the car that was parked last. So the car that was parked first would be the last to take out.


5.     Challenge
There are many examples of recursive functions and problems that fit immediately into a stack data structure in the design of the solution. Search for examples of this type of problem and specifically investigate:
a.       the fibonnaci numbers and
b.      the Towers of Hanoi
c.       In normal algebra we use the infix notation. Convert infix to the Reverse Polish notation ready for use by a calculator.

and explain how a stack can be used to solve what appear to be  otherwise complex problems. You do not need to write the PHP code but explain how it could be used to solve this type of problem.


Kind Regards


Kevork Krozian
Edulists Creator Administrator
www.edulists.com.au
tel: 0419 356 034

From: sofdev-bounces at edulists.com.au [mailto:sofdev-bounces at edulists.com.au] On Behalf Of Robert Hind
Sent: Monday, 24 January 2011 4:28 PM
To: Year 12 Software Development Teachers' Mailing List
Subject: Re: [Year 12 SofDev] PHP text available soon !!!

"I have attached the table of contents for the book "?


----- Original Message -----
From: Kevork Krozian<mailto:kevork at edulists.com.au>
To: 'Year 12 Software Development Teachers' Mailing List'<mailto:sofdev at edulists.com.au>
Sent: Monday, January 24, 2011 4:00 PM
Subject: Re: [Year 12 SofDev] PHP text available soon !!!

Hi Folks,

I am a little jealous .... just kidding !  I did invite Adrian to announce the new texts he has ready for the Software Development course.

I too have been busy writing a new book called “PHP programming with OOP and data visualization for Software Development” which is  an ebook of some 220 pages.
There is also a separate student workbook which will be available shortly with exercises for students ( and teachers ) to test their knowledge.

I have attached the table of contents for the book in the hope it may prove to be useful for teachers grappling with the new course. There are sample Case studies as well as a chapter on Use Cases and SRS along with suggested Assessment tasks.

Happy to hear comments or questions preferably directly to me on Kevork at edulists.com.au<mailto:Kevork at edulists.com.au>

Kind Regards

Kevork Krozian
Edulists Creator Administrator
www.edulists.com.au
tel: 0419 356 034

From: sofdev-bounces at edulists.com.au [mailto:sofdev-bounces at edulists.com.au] On Behalf Of Janson, Adrian A
Sent: Monday, 24 January 2011 12:23 AM
To: sofdev at edulists.com.au
Subject: [Year 12 SofDev] SD text now available!



Hi everyone,

I hope you have all had a restful break!  I wanted to email you all and let you know (those that are not on my contact list at least), that my text from SD ("Software Development: Core Techniques and Principles") is now available and I am in the process of sending it out to those schools and students that have placed orders.  If you would like to have a look at a sample chapter, there is one available for download at my website here:

http://www.adrianjanson.com.au/index.php?option=com_content&view=article&id=25&Itemid=27

The text is about 200 pages and is full colour.  It covers all aspects of the course and has been written specifically for the VCE 2011-2014 SD study design.

I also have the new edition of my Visual Basic.Net text available - titled ("Visual Basic.Net for Education: 2010 edition").  Preview pages are available for download here:

http://www.adrianjanson.com.au/index.php?option=com_content&view=article&id=4&Itemid=11

I hope you all have a really great year - and especially enjoy teaching the new course.

All the best,
Adrian Janson

Important - This email and any attachments may be confidential. If received in error, please contact us and delete all copies. Before opening or using attachments check them for viruses and defects. Regardless of any loss, damage or consequence, whether caused by the negligence of the sender or not, resulting directly or indirectly from the use of any attached files our liability is limited to resupplying any affected attachments. Any representations or opinions expressed are those of the individual sender, and not necessarily those of the Department of Education and Early Childhood Development.

________________________________
_______________________________________________
http://www.edulists.com.au - FAQ, Subscribe, Unsubscribe
IT Software Development Mailing List kindly supported by
http://www.vcaa.vic.edu.au - Victorian Curriculum and Assessment Authority and
http://www.vcaa.vic.edu.au/vce/studies/infotech/softwaredevel3-4.html
http://www.vitta.org.au  - VITTA Victorian Information Technology Teachers Association Inc



More information about the sofdev mailing list