HSC Software Engineering
Diagram Drawing Practice

Contents

1. Flowcharts - Algorithm and Process Visualization

2. Context Diagrams - System Boundaries and External Entities

3. Entity-Relationship Diagrams - Database Structure

4. Data Flow Diagrams - Internal Data Processing

5. UML Class Diagrams - Object-Oriented Design

6. Quick Reference Guide - Summary of All Diagrams

1. Flowcharts

What it is: A visual representation of an algorithm or process showing the sequence of steps and decision points.
When to use: Representing algorithms, decision-making processes, program logic, troubleshooting procedures.

Example:

Flowchart Example

Notation Key

Common Mistakes

Drawing Tips

PRACTICE EXERCISE 1: Flowchart
Scenario: Student Grade Classification System

Draw a flowchart for a system that:

  1. Receives a student's numeric mark (0-100) as input
  2. Determines the grade based on the following criteria:
    • 85-100: High Distinction (HD)
    • 75-84: Distinction (D)
    • 65-74: Credit (C)
    • 50-64: Pass (P)
    • 0-49: Fail (F)
  3. Outputs the letter grade
  4. Ends the process

2. Context Diagrams

What it is: A high-level diagram showing a system and its interactions with external entities (users, other systems).
When to use: System planning phase, identifying stakeholders, defining system boundaries, initial requirements analysis.

Example:

Context Diagram Example

Notation Key

Common Mistakes

Drawing Tips

PRACTICE EXERCISE 2: Context Diagram
Scenario: School Library Management System

Draw a context diagram for a library system with these external entities and interactions:

External Entities:

System Name: Library Management System (place in center)

3. Entity-Relationship (ER) Diagrams

What it is: A diagram showing database structure including entities (tables), attributes (fields), and relationships between entities.
When to use: Database design, showing data relationships, identifying primary and foreign keys, normalizing data structures.

Example:

ER Diagram Example

Notation Key

Common Mistakes

Drawing Tips

PRACTICE EXERCISE 3: Entity-Relationship Diagram
Scenario: Hospital Patient Management System

Draw an ER diagram with the following entities and relationships:

PATIENT

  • PatientID (PK), Name, DateOfBirth, Address, Phone
  • One patient can have many appointments

DOCTOR

  • DoctorID (PK), Name, Specialization, Phone
  • One doctor can have many appointments

APPOINTMENT

  • AppointmentID (PK), DateTime, Duration, Notes, PatientID (FK), DoctorID (FK)
  • Each appointment belongs to one patient and one doctor
  • One appointment can result in many prescriptions

PRESCRIPTION

  • PrescriptionID (PK), MedicationName, Dosage, Duration, AppointmentID (FK)
  • Each prescription belongs to one appointment

4. Data Flow Diagrams (DFD)

What it is: Shows how data moves through a system's internal processes, including data stores and transformations.
When to use: System analysis, showing internal processing steps, identifying data transformations, documenting how data flows between processes.

Example:

Data Flow Diagram Example

Notation Key

Common Mistakes

Drawing Tips

PRACTICE EXERCISE 4: Data Flow Diagram
Scenario: Online Food Ordering System

Draw a Level 0 DFD showing internal processes:

External Entity:

Processes (number as 1.0, 2.0, etc.):

Data Stores:

5. UML Class Diagrams

What it is: Shows object-oriented program structure including classes, attributes, methods, and relationships (inheritance, composition).
When to use: OOP design, showing class hierarchies, documenting inheritance relationships, planning code structure.

Example:

UML Class Diagram Example

Notation Key

Common Mistakes

Drawing Tips

PRACTICE EXERCISE 5: UML Class Diagram
Scenario: University Course Management System

Draw a class diagram with the following classes and relationships:

Person (parent/abstract class)

  • Attributes: -personID: int, -name: String, -email: String
  • Methods: +getName(): String, +getEmail(): String

Student (inherits from Person)

  • Attributes: -studentNumber: String, -major: String, -gpa: float
  • Methods: +enroll(course: Course): void, +getGPA(): float

Lecturer (inherits from Person)

  • Attributes: -employeeID: String, -department: String, -salary: float
  • Methods: +teach(course: Course): void, +getSalary(): float

Course

  • Attributes: -courseCode: String, -courseName: String, -credits: int
  • Methods: +getCourseInfo(): String, +addStudent(student: Student): void

Relationships:

Quick Reference Guide - All Diagrams

Diagram Type Purpose Key Notation When to Use
Flowchart Show algorithm steps and decision logic • Oval: Start/End
• Rectangle: Process
• Diamond: Decision
• Parallelogram: I/O
Algorithm design, process flow, troubleshooting
Context Diagram Show system boundary and external interactions • Circle: System (center)
• Rectangle: External entity
• Labeled arrows: Data flows
System planning, requirements gathering, stakeholder identification
ER Diagram Show database structure and relationships • Rectangle: Entity/Table
• Underline: Primary Key
• FK: Foreign Key
• Lines: 1:1, 1:M, M:N
Database design, data modeling, normalization
Data Flow Diagram Show internal data processing and storage • Rectangle: External entity
• Circle: Process (numbered)
• Parallel lines: Data store
• Arrows: Data flows
System analysis, process documentation, data transformation
UML Class Diagram Show OOP structure and relationships • 3-part box: Class
• +/-: Public/Private
• ▷: Inheritance
• ◆: Composition
• ◇: Aggregation
OOP design, class hierarchy, code planning

Common HSC Exam Question Types by Diagram

Flowcharts: "Draw a flowchart to show the algorithm for..." Common topics: validation, calculations, sorting

Context Diagrams: "Draw a context diagram for the described system showing all external entities and data flows"

ER Diagrams: "Design an ER diagram showing entities, attributes, primary/foreign keys, and relationships"

Data Flow Diagrams: "Draw a Level 0 DFD showing how data flows through the system's processes"

UML Class Diagrams: "Create a class diagram showing inheritance/composition relationships between the given classes"

Universal Drawing Tips for Exams