Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 9 - Multimedia IDCS - Computer Technology.

Similar presentations


Presentation on theme: "Chapter 9 - Multimedia IDCS - Computer Technology."— Presentation transcript:

1 Chapter 9 - Multimedia IDCS - Computer Technology

2 Programming Methods (CT)
Chapter 9 - Multimedia Programming Methods (CT) Chapter 3 SECTION B DATA ANALYSIS AND PROBLEMS IDCS - Computer Technology 3

3 Chapter CONTENTS: Analyzing problems
Designing a top-down modular program Determining the structure of a programm from a given specification Structured Programming diagrams CRC cards

4 Chapter 3 SECTION B Data Analysis and Problems
Chapter 9 - Multimedia Chapter 3 SECTION B Data Analysis and Problems PART 1 Analyzing the Problem IDCS - Computer Technology 3

5 1.1 Analysing the Problem Insist on a proper program specification
Analyse the problem Break down the problem down E.g. how to fix/change a flat tire

6 Example : Hospital Information System Module and Sub-modules
Chapter 9 - Multimedia Example : Hospital Information System Module and Sub-modules Hospital information System Personnel DB (Nurses, Doctors, etc) Patients DB (Emergency, OPD, etc) Transaction DB (Doctors + Patient, Payments) Inventory DB (Drugs, Medical Equipments) IDCS - Computer Technology 3

7 1.3 Definitions of Key Terms
 Top-down Development An approach to program development in which is made by: defining required elements in terms of basic elements beginning with the required program and ending when implementation language is reached At every stage during the top-down development, each of the undefined elements from the previous stage is defined. Stepwise refinement (enhancement) An approach to software development in which an initial, highly abstract representation of a required program is gradually refined through a sequence of intermediate representations.

8 1.3 Definitions of Key Terms (cont)
 Program Decomposition The breaking down of a complete program into a set of component parts called modules. E.g. Visual Basic Procedures Modular Programming A style of programming in which complete program is decomposed into a set of components (called modules) E.g. VB Module (illustrate) manageable size has well defined purpose has a well defined interface for use by other modules

9 1.4 Designing a Top-down Modular Program
One module contains the instructions that supply the top-down logic for the whole program This module contains the three basic functions: Initilialising Processing Closing down the program

10 1.5 Examples of Initialization Routines
Requesting library routines E.g. include <stdio.h> (C Language) Opening file Defining headings, creating opening screen Initialising variables E.g. Dim x as Integer, name as String (VB Language)

11 1.6 Examples of Processing Tasks
Input reading records from a file requesting data from the user Computation and logic comparing values computations assignments Output updating files writing records to a file printing a report displaying information on screen

12 1.7 Examples of Closing Tasks
Producing printed output Writing a file Printing final totals in a report Displaying final user messages Closing all open files

13 1.8 Jackson Structured Programming (JSP) - Iteration
Hierarchical diagrams can be used to illustrate a method of problem solving. But there must be way (for these diagram to be useful) of showing sequence, selection and iteration NOTE: JSP addresses the these different requirements: Reading records from a file Processing the element of an array Repeating procedures from a lower level in the diagram

14 1.9 Jackson Structured Programming - Iteration

15 1.10 Jackson Structured Programming (JSP)- Example 1
NOTE: Reading records until the End of File (EOF) Illustrate VB program example

16 1.11 Jackson Structured Programming (JSP)- Example 2
NOTE: Continue processing until user types stop.

17 1.12 Jackson Structured Programming (JSP)
You must also make a selection of such tasks such as: Choosing an alternative procedure at a lower level Taking actions according to the results of the entries Making comparisons and acting on the result NOTE: In this technique is to write the conditions above or below each box to be chosen results of the selection and insert an ‘0’ in the top right corner of the box.

18 1.12 Jackson Structured Programming (JSP)- Example 3
NOTE: Jackson Structure Diagram showing convention for selection Illustrate VB program example

19 1.13 Determining the Structure of a Program
Program is designed from the program specification SCENARIO: Assessment Results Program is to read a file of records of a students name Six examination marks (integer value) Calculate average mark Assessed grade FAIL, which is >39 and <=39 PASS, which is >39 and <=59 MERIT, which is >59 and ,<79 DISTINCTION, which is >79 Result to be written on new file Each record should contain name, average, percentage mark and grade On termination print students whom examination marks have been processed

20 1.13 Determining the Structure of a Program (cont.)
The program can be separated into components initialization tasks, processing tasks and closing tasks.

21 1.14 Stepwise Refinement – Step 1
Outline requirements for each component STEP 1: Initialising : Open files Processing : Process each record to find grades Closing : Close files

22 1.15 Stepwise Refinement – Step 2
They can be further divided to give each of the following refinements STEP 2: Initialising refinement : open file for reading and writing Processing refinement : set up lop to read in and process each record Closing refinement: close files, output closing message

23 1.16 Stepwise Refinement – Step 3
No further refinement needed for initialisation or termination Further analysis of the processing tasks is needed STEP 3: Processing of the records calculate the mean establish the grade write the results to a file count the number of records

24 1.16 Stepwise Refinement – Step 3 (cont.)

25 1.16 Stepwise Refinement – Step 4
Actions required to complete the diagram are easily determined Calculate average Accumulate marks Divide the total number of marks (6) Assign result average variable Assess grade Compare average with grade boundaries Write result to grade variable Write to file Write name variable + average mark + grade variable record Accumulate number of records Make sure this running total is at zero ate the beginning of the program

26 1.17 Jackson Structured Programming
This technique Uses a top-down stepwise refinement Uses only three control structures Bases the program design on the structure of the data to be processed The steps are: From the program specification, produce data structure diagrams of the data to be input for the processing and output Produce a program structure which reflects the requirements of the data structures Analyse this in a top-down manner to produce a more increasingly more specific program structure.

27 1.18 JSP Example 1 – Physical Data Structure
NOTE: A stock record is organized into sections by content (children's clothes, men's clothes, and women’s clothes). The data on children's clothes is to be extracted

28 1.19 JSP Example 1 – Logical Data Structure
NOTE: The logical data structure reflects that no processing.

29 1.20 JSP Example 2 – Physical Data Structure
NOTE: Physical data structure diagram of transaction file A transaction file has been created by inputting the information on sales and purchases in batches. Each batch has a header record followed by records with the details of sales and purchases. The batches of records are input as they are received and therefore can occur in any order.

30 1.21 JSP Example 2 – Logical Data Structure
NOTE: Logical data structure diagram of transaction file If sales report is required (no reference to purchases) which shows totals for both cash and credit sales as shown above. Every record will no longer be processes and the purchases will be ignored.

31 1.22 Establishing the Program Structure
Criteria: Determine the input and output data structures The output requirements are a great help in determining the logical structure of a file. Combining them to produce the program structure The example is process is illustrated is on the next slide

32 Physical and Logical DSDs
1.23 Example 1 : Using One Input File to Produce One Output File or Report Physical and Logical DSDs

33 1.24 Example 1 : Continued.. Physical DSD - Report NOTE:
The report structure is to have a heading, a on-line summary of the total order value for each garage, and a footer containing the total of all orders.

34 Comparison of Physical DSDs
1.25 Example 1 : Continued.. Comparison of Physical DSDs

35 DSDs of Input and Output
1.26 Example 1 : Continued.. Comparison of Logical DSDs of Input and Output

36 1.27 Comparison of Logical DSDs of Input and Output (cont.)
Explanation of Previous Slide The output requirement does not need to include the area of each garage The logical DSD of the input files, do not need to include this component.

37 1.28 Program Structure NOTE: PSD Properties
Each data component is related only to one program component. Each program component is related only to one input and/or one out component.

38 Chapter 3 Data Analysis and Problems
Chapter 9 - Multimedia Chapter 3 Data Analysis and Problems PART 2 CRC Diagrams IDCS - Computer Technology 3

39 2.1 What are CRC Cards? CRC Cards stands for:
Class Responsibility Collaboration Created in the late 1980s as a method to teach object oriented paradigm

40 2.2 What are CRC Cards? (cont..)
CRC cards aimed to find a way to express a system in an abstract way that was analogous to structured programming. CRC cards are brainstorming tool used when first determining which classes are needed and how they will interact.

41 2.3 Advantages of CRC Based Modelling
There are many advantages in using a CRC- based modelling Creates a good understanding of the domain to be modelled It identifies high level of responsibilities It ensures better system design It ensures that knowledge of the domain is shared by anyone A good working can be developed It is a good way to identify areas that maybe missed otherwise It is a fun

42 2.4 CRC Finding Classes and Considering Scenarios
Participants need to know what the requirements of the system will be Brainstorming the major classes for the system are identified Individual classes can then be discussed and refined until a set is agreed The group then considers scenarios likely to occur, to test the classes some will be discarded, others will become subclasses A subclass is a class within a class sharing some of the attributes and behaviors of its parent, but having attributes and behaviors of its own

43 2.5 CRC Method A CRC card session should involve about five or six people include people who have a detailed understanding of the system to be developed Begin with a brainstorming session usually someone oversees the session, recording suggestions on a flipchart/board these suggestions form the basis of the classes for the system Next, the classes suggested are discussed in detail and some will be filtered out

44 2.6 CRC Method (cont.) Each class is written on a card, and assigned to a participant a short description can be added on the back of the card, which can be read out to the group for approval Next, the group considers simple scenarios which are likely to occur helps to discover any missing classes, and the relationships that objects have to each other Scenarios involve a discussion of how the classes behave and how they interact with each other

45 Chapter SUMMARY In this Chapter we have covered:
Program development process Structure diagrams Organizing information Fixed and variable length record Analyzing the problem Structured programming diagrams CRC cards introduction including scenarios, role play and method FINAL NOTE: To facilitate better understanding of all of these methods, techniques and methodologies, you are advised to work through the Self Study Section and Exercises at the end each Chapter on your Textbook.


Download ppt "Chapter 9 - Multimedia IDCS - Computer Technology."

Similar presentations


Ads by Google