Presentation is loading. Please wait.

Presentation is loading. Please wait.

Practical Programming COMP153-08S Week 6: Program Design/Development, Arrays.

Similar presentations


Presentation on theme: "Practical Programming COMP153-08S Week 6: Program Design/Development, Arrays."— Presentation transcript:

1 Practical Programming COMP153-08S Week 6: Program Design/Development, Arrays

2 Four Essential Phases for Software Development Requirements –Specifications from user, analysis from programmer System Design Coding Testing

3 Tools to assist with System Design Task Object Event chart Flow Chart Pseudo Code Paper Prototype

4 Task Object Event (TOE) chart Task ObjectEvent Clear the screenEntDateLabel, DateDisplayLabel Startup 1.Get date from User: 2.Calculate day, month 3.Display in DateDisplayLabel AddDateButtonClick 1.Calculate new day, month 2.Display in DateDisplayLabel NZRadioButton USRadioButton Click End the applicationExitButtonClick

5 Flow Charts start Enter date Separate day & month NZ date? Select month name Switch day & month display end No Yes

6 Pseudo Code 1.Clear labels 2.Get DateStr from user 3.Extract Day & Month from Datestr 4.If not NZ date then swap Day & Month 5.Determine MonthName 6.Display Day and MonthName 7.End

7 Paper Prototype

8 Software Development Life Cycle Has birth, various stages, then an end A model of the phases in which software is built Many different variations Programming is only a small part

9 Big Bang Model Developer receives problem statement Developer works in isolation for a long period of time Developer delivers results Developer hopes client is satisfied

10 Requirements Specification Design Coding Testing Commission Maintenance Traditional Waterfall Model

11 Requirements Specification Design Coding Testing Commission Maintenance Waterfall Model with backflow

12 Rapid Prototyping Model Build prototypes before real system Formal Methods – Transformation Animate/Prove specification Design steps that preserve correctness Iterative/Spiral Model Build final system in several independent sections Extreme Programming Model Small iterations, Frequent testing, Pair Programming… Other Software Development Life Cycles

13 What is an Array?

14

15 A group of items that are stored together, that have similar characteristics, and are related in some way

16 What is an Array in Visual Basic? A group of variables that are stored together, have the same data type, and are named in the same way

17 Creating an Array Dim NZBWCD(9) as string Dim Players(14) as string Dim BatsmanScore(11) as Integer Dim Absentees() As String ={“Jim”, “James”, “John”, “Jack”} Dim Heights() As Decimal = {48, 54, 82, 59, 78, 68, 54}

18 Storing Data in an Array NZBWCD(5) =“NZO6” Players(6) = “Peter” BatsmanScore(0) = 100 Absentees(2) = “Mary” Heights(5) = 100

19 Two other Array Commands Array.Sort(Players) Array.Reverse(BatsmanScore)

20 Parallel One Dimensional Arrays Two (or more) one dimensional arrays whose elements are directly related by their position GolpherName(0) relates to GolpherScore(0) GolpherName(1) relates to GolpherScore(1) GolpherName(2) relates to GolpherScore(2) Note: be careful when sorting these! Note: these arrays have different data types.

21 Two Dimensional Arrays Dim BattingScores(11,1) As Integer BattingScores(3,0) = 57 BattingScores(3,1) = 74 BatterTotal = BattingScores (3,0) + BattingScores (3,1) BatterMessage.txt = “The total for this batsman is ” _ & BatterTotal

22 THE END of the lecture


Download ppt "Practical Programming COMP153-08S Week 6: Program Design/Development, Arrays."

Similar presentations


Ads by Google