progressive disclosure diagramming techniques haytham siala email: [email protected] tel:...

27
Progressive Disclosure Diagramming Techniques Haytham Siala Email: [email protected] Tel: 0208 392 3481

Upload: rafe-griffin

Post on 11-Jan-2016

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Progressive Disclosure Diagramming Techniques Haytham Siala Email: h.siala@roehampton.ac.uk Tel: 0208 392 3481

Progressive Disclosure Diagramming Techniques

Haytham Siala

Email: [email protected]

Tel: 0208 392 3481

Page 2: Progressive Disclosure Diagramming Techniques Haytham Siala Email: h.siala@roehampton.ac.uk Tel: 0208 392 3481

Agenda

• Visual Aid to Computer Programming

• CASE and Basic Diagramming Tools

• Challenges Ahead for Teaching Computer Programming

Page 3: Progressive Disclosure Diagramming Techniques Haytham Siala Email: h.siala@roehampton.ac.uk Tel: 0208 392 3481

Overview

• Visual Aid to Computer Programming• Flowcharts• Activity Diagrams• Code Tracers and Debuggers (post-mortem)

Page 4: Progressive Disclosure Diagramming Techniques Haytham Siala Email: h.siala@roehampton.ac.uk Tel: 0208 392 3481

Audience

• Cohort of First Year students

• Difficult to assimilate programming techniques

• Lack of self-motivation

• Steep learning curve in stark contrast to other modules:• Fundamentals of DBMS, Graphic Design,

Hardware Theory and Practice, etc.

Page 5: Progressive Disclosure Diagramming Techniques Haytham Siala Email: h.siala@roehampton.ac.uk Tel: 0208 392 3481

Designing Programming Solutions

There are 'visual' alternatives to algorithms and pseudo code, the most common of which are:

• Flowcharts (dated)• No diagramming tools

• Currently synonymous with business process modelling

• Activity Diagrams (UML)• A plethora of diagramming tools

Page 6: Progressive Disclosure Diagramming Techniques Haytham Siala Email: h.siala@roehampton.ac.uk Tel: 0208 392 3481

Start

num1=0, num2= 0, result = 0

Read num1, num2

result = num1 + num2

Output result

Stop

Flowcharts

Page 7: Progressive Disclosure Diagramming Techniques Haytham Siala Email: h.siala@roehampton.ac.uk Tel: 0208 392 3481

UML Activity Diagrams

• UML (Unified Modelling Language) • Blueprint: visually illustrates the flow (logical

sequence) of a programming solution (algorithm).

• Activity diagrams aid in breaking down a problem into simple steps

Page 8: Progressive Disclosure Diagramming Techniques Haytham Siala Email: h.siala@roehampton.ac.uk Tel: 0208 392 3481

Activity Diagram Symbols

Initial Activity: This shows the starting point of the flow. Denoted by a solid circle.

Final Activity: The end of the Activity diagram is shown by a bull's eye symbol.

Activity: Represented by a rectangle with rounded edges. Indicates that an action is performed by the computer program, such as a mathematical computation or printing something to the screen.

Decision. The diamond indicates a decision structure. A diamond always has two flowlines out. Each flowline is labeled with a suitable 'guard' expression that represents a test condition. Each guard expression is written within square brackets.

Activity

[age >= 18] [age < 18]

Activity 1 Activity 2

Next Action

In addition, a diamond with incoming arrows and no brackets (guard conditions) can be used to merge different activities (converge) once they have completed performing the required actions.

Page 9: Progressive Disclosure Diagramming Techniques Haytham Siala Email: h.siala@roehampton.ac.uk Tel: 0208 392 3481

Activity Diagram Symbols

Note: Used for showing additional information or more specific detail about an activity.

Flowline. Flowlines connect the symbols of the activity diagram and show the sequence of operations during the program execution.

Page 10: Progressive Disclosure Diagramming Techniques Haytham Siala Email: h.siala@roehampton.ac.uk Tel: 0208 392 3481

Activity Diagram Example 1

Get User Input

[age > 18] [age <18] Print "You are a minor"; Print "You are an adult";

Page 11: Progressive Disclosure Diagramming Techniques Haytham Siala Email: h.siala@roehampton.ac.uk Tel: 0208 392 3481

Activity Diagram Example 2

Get Dressed

[In time to catch train] [Too late to catch train]

Take train to University Take cab to University

Page 12: Progressive Disclosure Diagramming Techniques Haytham Siala Email: h.siala@roehampton.ac.uk Tel: 0208 392 3481

Anatomy of a C++ program

#include "stdafx.h"

#include <iostream>

using namespace std;

int main()

{

cout << "Hello Word!";

return 0; // indicates that program has ended successfully

} // end function main

Libraries: toolbox of

the tools you need

Comment

General Manager: Starting point of program execution

Output statement

Begin

End

namespace

Page 13: Progressive Disclosure Diagramming Techniques Haytham Siala Email: h.siala@roehampton.ac.uk Tel: 0208 392 3481
Page 14: Progressive Disclosure Diagramming Techniques Haytham Siala Email: h.siala@roehampton.ac.uk Tel: 0208 392 3481

Declare and initialise the required variables

int num1=0, num2=0, num3=0, sum=0, avg=0;

Read 3 numbers from user

cin >> num1;cin >> num2;cin >> num3;

Add the 3 numbers and store the result

sum = num1 + num2 + num3;

Calculate the average of the 3 numbers

avg = sum / 3;

Display the sum of the 3 numbers

cout <<"Sum = " << sum;

Display the average of the 3 numbers

cout << "Average = " << avg;

Pause program execution

cin.ignore();

Page 15: Progressive Disclosure Diagramming Techniques Haytham Siala Email: h.siala@roehampton.ac.uk Tel: 0208 392 3481

#include "stdafx.h"#include <iostream> using namespace std;

int main() {

return 0; }

Page 16: Progressive Disclosure Diagramming Techniques Haytham Siala Email: h.siala@roehampton.ac.uk Tel: 0208 392 3481

#include "stdafx.h"#include <iostream> using namespace std;

int main() { int num1=0, num2=0, num3=0, sum=0, avg=0;

return 0; }

Declare and initialise the required variables

int num1=0, num2=0, num3=0, sum=0, avg=0;

Page 17: Progressive Disclosure Diagramming Techniques Haytham Siala Email: h.siala@roehampton.ac.uk Tel: 0208 392 3481

#include "stdafx.h"#include <iostream> using namespace std; int main() { int num1=0, num2=0, num3=0, sum=0, avg=0; cout << "Please enter 3 numbers"; cin >> num1; cin >> num2; cin >> num3;

return 0; }

Declare and initialise the required variables

int num1=0, num2=0, num3=0, sum=0, avg=0;

Read 3 numbers from user

cin >> num1;cin >> num2;cin >> num3;

Page 18: Progressive Disclosure Diagramming Techniques Haytham Siala Email: h.siala@roehampton.ac.uk Tel: 0208 392 3481

#include "stdafx.h"#include <iostream> using namespace std; int main() { int num1=0, num2=0, num3=0, sum=0, avg=0; cout << "Please enter 3 numbers"; cin >> num1; cin >> num2; cin >> num3; sum = num1 + num2 + num3;

return 0; }

Declare and initialise the required variables

int num1=0, num2=0, num3=0, sum=0, avg=0;

Read 3 numbers from user

cin >> num1;cin >> num2;cin >> num3;

Add the 3 numbers and store the result

sum = num1 + num2 + num3;

Page 19: Progressive Disclosure Diagramming Techniques Haytham Siala Email: h.siala@roehampton.ac.uk Tel: 0208 392 3481

#include "stdafx.h"#include <iostream> using namespace std; int main() { int num1=0, num2=0, num3=0, sum=0, avg=0; cout << "Please enter 3 numbers"; cin >> num1; cin >> num2; cin >> num3; sum = num1 + num2 + num3; avg = sum / 3;

return 0; }

Declare and initialise the required variables

int num1=0, num2=0, num3=0, sum=0, avg=0;

Read 3 numbers from user

cin >> num1;cin >> num2;cin >> num3;

Add the 3 numbers and store the result

sum = num1 + num2 + num3;

Calculate the average of the 3 numbers

avg = sum / 3;

Page 20: Progressive Disclosure Diagramming Techniques Haytham Siala Email: h.siala@roehampton.ac.uk Tel: 0208 392 3481

#include "stdafx.h"#include <iostream> using namespace std; int main() { int num1=0, num2=0, num3=0, sum=0, avg=0; cout << "Please enter 3 numbers"; cin >> num1; cin >> num2; cin >> num3; sum = num1 + num2 + num3; avg = sum / 3; cout << "Sum = " << sum; return 0; }

Declare and initialise the required variables

int num1=0, num2=0, num3=0, sum=0, avg=0;

Read 3 numbers from user

cin >> num1;cin >> num2;cin >> num3;

Add the 3 numbers and store the result

sum = num1 + num2 + num3;

Calculate the average of the 3 numbers

avg = sum / 3;

Display the sum of the 3 numbers

cout <<"Sum = " << sum;

Page 21: Progressive Disclosure Diagramming Techniques Haytham Siala Email: h.siala@roehampton.ac.uk Tel: 0208 392 3481

#include "stdafx.h"#include <iostream> using namespace std; int main() { int num1=0, num2=0, num3=0, sum=0, avg=0; cout << "Please enter 3 numbers"; cin >> num1; cin >> num2; cin >> num3; sum = num1 + num2 + num3; avg = sum / 3; cout << "Sum = " << sum; cout << "Average = " << avg; return 0; }

Declare and initialise the required variables

int num1=0, num2=0, num3=0, sum=0, avg=0;

Read 3 numbers from user

cin >> num1;cin >> num2;cin >> num3;

Add the 3 numbers and store the result

sum = num1 + num2 + num3;

Calculate the average of the 3 numbers

avg = sum / 3;

Display the sum of the 3 numbers

cout <<"Sum = " << sum;

Display the average of the 3 numbers

cout << "Average = " << avg;

Page 22: Progressive Disclosure Diagramming Techniques Haytham Siala Email: h.siala@roehampton.ac.uk Tel: 0208 392 3481

#include "stdafx.h"#include <iostream> using namespace std; int main() { int num1=0, num2=0, num3=0, sum=0, avg=0; cout << "Please enter 3 numbers"; cin >> num1; cin >> num2; cin >> num3; sum = num1 + num2 + num3; avg = sum / 3; cout << "Sum = " << sum; cout << "Average = " << avg; cin.ignore(); return 0; }

Declare and initialise the required variables

int num1=0, num2=0, num3=0, sum=0, avg=0;

Read 3 numbers from user

cin >> num1;cin >> num2;cin >> num3;

Add the 3 numbers and store the result

sum = num1 + num2 + num3;

Calculate the average of the 3 numbers

avg = sum / 3;

Display the sum of the 3 numbers

cout <<"Sum = " << sum;

Display the average of the 3 numbers

cout << "Average = " << avg;

Pause program execution

cin.ignore();

Page 23: Progressive Disclosure Diagramming Techniques Haytham Siala Email: h.siala@roehampton.ac.uk Tel: 0208 392 3481

#include "stdafx.h"#include <iostream> using namespace std; int main() { int num1=0, num2=0, num3=0, sum=0, avg=0; cout << "Please enter 3 numbers"; cin >> num1; cin >> num2; cin >> num3; sum = num1 + num2 + num3; avg = sum / 3; cout << "Sum = " << sum; cout << "Average = " << avg; cin.ignore(); return 0; }

Declare and initialise the required variables

int num1=0, num2=0, num3=0, sum=0, avg=0;

Read 3 numbers from user

cin >> num1;cin >> num2;cin >> num3;

Add the 3 numbers and store the result

sum = num1 + num2 + num3;

Calculate the average of the 3 numbers

avg = sum / 3;

Display the sum of the 3 numbers

cout <<"Sum = " << sum;

Display the average of the 3 numbers

cout << "Average = " << avg;

Pause program execution

cin.ignore();

Page 24: Progressive Disclosure Diagramming Techniques Haytham Siala Email: h.siala@roehampton.ac.uk Tel: 0208 392 3481

CASE and Basic Diagramming Tools

• General• Visio, SmartDraw

• OOP• BlueJ, Enterprise Architect, Eclipse, Rational Rose, Select

Architect, Visual Paradigm

• CASE tools (including a code generation feature)• OOP

– Visual Paradigm (commercial)– Rational Rose (commercial)– BlueJ (open-source)

• Procedural – Scarce or non-existent?

Page 25: Progressive Disclosure Diagramming Techniques Haytham Siala Email: h.siala@roehampton.ac.uk Tel: 0208 392 3481

Compromise: Visio + Visual IDE

Page 26: Progressive Disclosure Diagramming Techniques Haytham Siala Email: h.siala@roehampton.ac.uk Tel: 0208 392 3481

Compromise: Visio + Visual IDE

• Disjointed effort between the design and the implementation of a programming solution

• Students don't mind investing time in designing a programming blueprint as long as it saves them time in writing the code for the solution.

Page 27: Progressive Disclosure Diagramming Techniques Haytham Siala Email: h.siala@roehampton.ac.uk Tel: 0208 392 3481

The Challenges Ahead…

• The 2-pane Powerpoint slide presentation cannot be used effectively for demonstrating a complex programming solution (e.g. with multiple conditional statements and loops)

• Request for • an alternative to standard presentation software that is

more fit for presenting and teaching programming topics

• an affordable CASE tool that includes a 'code-generation' feature for basic procedural programming

• Bigger LCD projector screens/ computer monitors for preparing and demonstrating programming lectures