Mark Dixon Page 1 15 – Structured Programming. Mark Dixon Page 2 Admin: Coursework 3 – Test In class test –9 Feb 2010 –2 Feb 2010: revision (technique)

Slides:



Advertisements
Similar presentations
Mark Dixon Page 1 23 – Object Oriented Programming in PhP.
Advertisements

Mark Dixon, SoCCE SOFT 131Page 1 15 – Object Oriented Analysis, Design, and Programming.
Mark Dixon, SoCCE SOFT 131Page 1 22 – Object Oriented Analysis, Design, and Programming.
Mark Dixon Page 1 16 – Passing Data between pages: Forms, Sessions, & Query Strings.
Mark Dixon Page 1 12 – Functions and Modules. Mark Dixon Page 2 Questions: Parameters Name a parameter in the following code: Sub Move(ByRef obj, ByVal.
Mark Dixon Page 1 04 – Database Design: Forms. Mark Dixon Page 2 Session Aims & Objectives Aims –To allow easier data entry using forms Objectives, by.
Mark Dixon Page 1 22 – Object Oriented Programming in ASP.
Mark Dixon Page 1 05 – Constants and Variables. Mark Dixon Page 2 Admin: Test (next week) In class test –teaching week 6 50 mins short answer (5 - 6 words.
Mark Dixon Page 1 05 – Conditional Execution. Mark Dixon Page 2 Admin: Test (next week) In class test –teaching week 6 50 minutes short answer (5 - 6.
Mark Dixon, SoCCE SOFT 136Page 1 11 – User Defined Functions.
Mark Dixon, SoCCE SOFT 131Page 1 13 – Object Oriented Analysis, Design, and Programming.
Mark Dixon, SoCCE SOFT 131Page 1 07 – Iterative Execution.
Mark Dixon, SoCCE SOFT 131Page 1 06 – Iteration. Mark Dixon, SoCCE SOFT 131Page 2 Session Aims & Objectives Aims –Revise Variables and Conditional execution.
Mark Dixon, SoCCE SOFT 131Page 1 10 – Enumerated Data Types & Procedure Parameters.
Mark Dixon, SoCCE SOFT 131Page 1 06 – Iteration. Mark Dixon, SoCCE SOFT 131Page 2 Session Aims & Objectives Aims –To introduce the main concepts involved.
Mark Dixon, SoCCE SOFT 131Page 1 19 – Procedure Parameters.
Mark Dixon Page 1 21 – Object Oriented Programming in ASP.
Mark Dixon, SoCCE SOFT 131Page 1 08 – Iterative Execution.
Mark Dixon Page 1 02 – Queries: Query by Example.
Mark Dixon Page 1 13 – Object Oriented Programming.
Mark Dixon, SoCCE SOFT 131Page 1 05 – Constants and Variables.
Mark Dixon, SoCCE SOFT 131Page 1 04 – Conditional Execution.
Mark Dixon Page 1 20 – Web applications: Writing data to Databases using ASP.
Mark Dixon Page 1 In-class Test Results Student Number Score (max 50) Classification is for guidance only Please feel free to come and discuss your results.
Mark Dixon, SoCCE SOFT 131Page 1 25 – Soft 131 Examination Revision.
Mark Dixon Page 1 22 – Coursework 2 Debrief: Phonics.
Mark Dixon Page 1 10 – Iterative Execution. Mark Dixon Page 2 Questions: Variables Write a line of code to declare a variable called h Write a line of.
Mark Dixon Page 1 19 – Passing Data between pages: Forms, Sessions, & Query Strings.
Mark Dixon Page 1 23 – Web applications: Writing data to Databases using PhP.
Mark Dixon Page 1 24 – Object Oriented Programming in ASP.
Mark Dixon 1 07 – Variables. Mark Dixon 2 Questions: Conditional Execution What is the result of (txtFah.value is 50): (txtFah.value >= 40) What will.
Mark Dixon 1 22 – Web applications: Writing data to Databases using ASP.Net.
Mark Dixon Page 1 23 – Web applications: Writing data to Databases using ASP.
Mark Dixon Page 1 09 – Arrays. Mark Dixon Page 2 Questions: Loops What is the value of t, after this code executes? t = 0 For x = 4 To 6 t = t + x Next.
Mark Dixon, SoCCE SOFT 136Page 1 9 – Procedures. Mark Dixon, SoCCE SOFT 136Page 2 Session Aims & Objectives Aims –To introduce the main concepts involved.
Mark Dixon Page 1 10 – Procedures. Mark Dixon Page 2 Session Aims & Objectives Aims –To introduce the main concepts involved in grouping instructions,
Mark Dixon 1 05 – Conditional Execution. Mark Dixon 2 Admin: Test (next week) In class test –teaching week 6 50 minutes short answer (5 - 6 words) currently.
Mark Dixon 1 11 – Array Variables. Mark Dixon 2 Questions: Loops What is the value of t, after this code executes? t = 0 For x = 4 To 6 t = t + x Next.
Mark Dixon Page 1 10 – Array Variables. Mark Dixon Page 2 C1 – In-class test Results mixed: –quite a few fails 34% (13/38) –some very good (91% max) ask.
Object Oriented Programming Lecture 5: BallWorld.
Mark Dixon 1 08 – Variables. Mark Dixon 2 Questions: Conditional Execution What is the result of (txtFah.value is 50): (txtFah.value >= 40) What will.
Mark Dixon, SoCCE SOFT 131Page 1 05 – Variables. Mark Dixon, SoCCE SOFT 131Page 2 Admin: Test (next week) In class test –teaching week 6 –university week.
Mark Dixon Page 1 03 – Dynamic HTML (client-side scripting)
Mark Dixon 1 14 – Functions and Modules. Mark Dixon 2 Questions: Parameters Consider the following code: Sub Move(ByRef obj, ByVal dist) obj.style.posLeft.
Mark Dixon, SoCCE SOFT 131Page 1 24 – Datatypes and Object Association.
Mark Dixon Page 1 03 – Dynamic HTML (client-side scripting)
Mark Dixon Page 1 09 – Problem Solving. Mark Dixon Page 2 Admin: Test 1 Marked One-to-one debriefs, you can –Look at your script –Look at mark scheme.
Mark Dixon Page 1 8 – Procedures. Mark Dixon Page 2 Session Aims & Objectives Aims –To introduce the main concepts involved in grouping instructions,
Mark Dixon Page 1 Tech – HTML. Mark Dixon Page 2 Admin Attendance Register: –log in to your profile.
Mark Dixon, SoCCE SOFT 131Page 1 18 – Enumerated Data Types and Arrays of Structures.
Mark Dixon Page 1 08 – Variables. Mark Dixon Page 2 Questions: Conditional Execution What is the result of (txtFah.value is 50): (txtFah.value >= 40)
Mark Dixon Page 1 08 – Variables. Mark Dixon Page 2 Questions: Conditional Execution What is the result of (txtFah.value is 50): (txtFah.value >= 40)
Mark Dixon SOFT 131Page 1 12 – Object Oriented Analysis, Design, and Programming.
Mark Dixon 1 22 – Object Oriented Programming. Mark Dixon 2 Questions: Databases How many primary keys? How many foreign keys? 3 2.
Mark Dixon 1 06 – Conditional Execution. Mark Dixon 2 Admin: Test (next week) In class test –teaching week 7 50 minutes short answer (5 - 6 words max)
Mark Dixon Page 1 04 – Conditional Execution. Mark Dixon Page 2 Questions: Expressions a)What is the result of: 10 * Int( ) b)How many functions.
Mark Dixon, SoCCE SOFT 131Page 1 17 – Procedures.
Mark Dixon 1 15 – Structured Programming. Mark Dixon 2 Admin: Test 2 In class test –11 Feb 2014 –4 Feb 2014: revision (technique) session 50 mins short.
Mark Dixon 1 13 – Parameters. Mark Dixon 2 Question: Arrays How many array variables are in the following code: Dim x Dim y Dim f(4) x = 12 y = 6 f(2)
Mark Dixon, SoCCE SOFT 131Page 1 25 – Soft 131 Examination Revision.
Mark Dixon Page 1 09 – Iterative Execution. Mark Dixon Page 2 Questions: Variables Write a line of VBScript code to declare a variable called h Write.
Mark Dixon, SoCCE SOFT 131Page 1 03 – Conditional Execution.
Sub Procedures and Functions Visual Basic. Sub Procedures Slide 2 of 26 Topic & Structure of the lesson Introduction to Modular Design Concepts Write.
15 – Structured Programming
12 – Object Oriented Programming
23 – Object Oriented Programming in ASP
17 – Modular Design in ASP.
08 – Iterative Execution.
11 – Functions and Modules
Presentation transcript:

Mark Dixon Page 1 15 – Structured Programming

Mark Dixon Page 2 Admin: Coursework 3 – Test In class test –9 Feb 2010 –2 Feb 2010: revision (technique) session 50 mins short answer (5 - 6 words max) 25% of coursework mark

Mark Dixon Page 3 Questions: Functions Consider the following code: Function Smallest(num1, num2) If num1 < num2 Then Smallest = num1 Else Smallest = num2 End If End Function name a function. what is left in small after the following is executed? Dim small small = Smallest(23, 15) 15 Smallest

Mark Dixon Page 4 Session Aims & Objectives Aims –To highlight the fundamental ideas of the structured programming paradigm Objectives, by end of this week’s sessions, you should be able to: –create an abstract data type, which includes data, and routines –use this to reduce code length

Mark Dixon Page 5 Example: Ball Bounce v1 Ball Bounce Option Explicit Dim x Dim y Dim xInc Dim yInc Sub window_onLoad() window.setinterval "Main()", 20 xInc = 5 yInc = 3 End Sub Sub Main() x = imgBall.style.posLeft + xInc If x = document.body.clientWidth - imgBall.width Then xInc = -xInc Else imgBall.style.posLeft = x End If y = imgBall.style.posTop + yInc If y = document.body.clientHeight - imgBall.height Then yInc = -yInc Else imgBall.style.posTop = y End If End Sub

Mark Dixon Page 6 Structured Paradigm Program made up of –data structures, and –routines (procedures and functions) that process the data within those structures. Each routine should perform a single, clearly identifiable operation. Each routine should be self-contained Abstract data type = structure + procedures

Mark Dixon Page 7 Example: Ball Bounce v2 Option Explicit Dim x Dim y Dim xInc Dim yInc Sub Init(tmpXInc, tmpYInc) xInc = tmpXInc yInc = tmpYInc End Sub Sub Move(img) x = img.style.posLeft + xInc If x = document.body.clientWidth - img.width Then xInc = -xInc Else img.style.posLeft = x End If y = img.style.posTop + yInc If y = document.body.clientHeight - img.height Then yInc = -yInc Else img.style.posTop = y End If End Sub Ball Bounce Option Explicit Sub window_onLoad() window.setinterval "Main()", 20 Init 5, 3 End Sub Sub Main() Move imgBall End Sub BallBounce.htm Sprite.vbs

Mark Dixon Page 8 Example: Balloon Shoot Question: –what objects? –what variables? –what procedures / functions?

Mark Dixon Page 9 Tutorial Exercise: Ball Bounce Learning Objective: To create and use your own class. Task 1: Get the Ball Bounce examples (1, 2, and 5) from the lecture working. Task 2: Add a hit method to the sprite class, which detects the collision with another sprite. Task 3: Modify your page to count the number of hits between the two sprites. Task 4: Modify your page to make sprites bounce off each other. Task 5: Add another sprite.

Mark Dixon Page 10 Tutorial Exercise: Balloon Shoot Learning Objective: To create and use your own classes. Task 1: Create the Balloon Shoot example (from the lecture) using object oriented concepts (classes, properties, methods, and instances) hint: use some of the code from your Interceptor example (from last week)