Presentation is loading. Please wait.

Presentation is loading. Please wait.

Faculty of Sciences and Social Sciences HOPE Structured Problem Solving An Introduction Stewart Blakeway 0151 291 3113.

Similar presentations


Presentation on theme: "Faculty of Sciences and Social Sciences HOPE Structured Problem Solving An Introduction Stewart Blakeway 0151 291 3113."— Presentation transcript:

1 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE Structured Problem Solving An Introduction Stewart Blakeway blakews@hope.ac.uk 0151 291 3113

2 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE Aims of the presentation to quickly list the skills to be developed on the SPS strand of the course to officially start the course

3 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 3 Skills to be developed in the SPS strand of the course Problem Solving Skills Programming Skills Team Interaction Skills Presentation Skills Reflective Skills The most important bit

4 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 4 Skills to be developed in the SPS strand of the module Problem Solving Skills Programming Skills Team Interaction Skills Presentation Skills Reflective Skills

5 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 5 Problem Solving Skills Analysis of Problems – Crossing a busy road – Eating a Pie – Cooking a Pie – Climbing Mount Everest ?????? – Getting PieEater to do something complicated – Writing other software to do something complicated

6 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 6 Problem Solving Skills Analysis of the Structure of Solutions – Sequence – Selection – Repetition

7 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 7 Problem Solving Skills Structured English – Sequence – Selection – Repetition

8 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 8 Skills to be developed in the SPS strand of the module Problem Solving Skills Programming Skills Team Interaction Skills Presentation Skills Reflective Skills

9 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 9 Programming Skills Introduction to Java – Java Programming Constructs – Java Trainer – The PieEater Java revisited – Object Oriented Concepts – BlueJ Integrated Development Environment (http://www.bluej.org/about/what.html)http://www.bluej.org/about/what.html – The PieEater again plus Close Friends – Graphics and Animation

10 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 10 Programming Skills Data Structures – Selection of Appropriate Data Structures – Sorting – Searching

11 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 11 Skills to be developed in the SPS strand of the module Problem Solving Skills Programming Skills Team Interaction Skills Presentation Skills Reflective Skills

12 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 12 Team Interaction Skills Animation Problems – Solved in Groups – Coded in Groups – Tested in Groups

13 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 13 Skills to be developed in the SPS strand of the module Problem Solving Skills Programming Skills Team Interaction Skills Presentation Skills Reflective Skills

14 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 14 Presentation Skills Presentation of Working Animations – Demonstration of the Running Animation – Explanation of the Choice of Variables – Explanation of the Algorithmic Design – Explanation of the Data Structures Selected – Discussion of Possible Enhancements

15 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 15 Skills to be developed in the SPS strand of the module Problem Solving Skills Programming Skills Team Interaction Skills Presentation Skills Reflective Skills

16 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 16 Reflective Skills Reflect on Team Work Activities Reflect on the Scope of the Task Highlight Possible Failings in the Mechanics of the Team Work Activity Suggest Possible Improvements to Team Work Interaction

17 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 17 Let the course begin …..

18 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 18 Your First Seminar createpieeater(); pendown(); walk(); penup(); walk(); pendown(); turnright(); walk();

19 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 19 Let’s Loop-the-Loop createpieeater(); while (test) { actions; } other actions; Sequences of Actions each Ending with a Semi Colon No Semi Colons

20 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 20 Semi-colons: a working rule Do not put them at the end of while() if () { } Do put them at the end of other lines int a; a = 7; turnleft();

21 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 21 while (test) { } test – clearahead – direction != “SW” – pieinsight clearahead and pieinsight are either true or false direction != “SE” can be evaluated to either true or false

22 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 22 Loop Operation while (test) { actions; } other actions; Evaluate test truefalse

23 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 23 Test is True while (test) { » actions; } other actions; Enter Body of Loop Execute [actions;] Evaluate test Again Body of Loop

24 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 24 Test is True while (test) { » actions; } other actions; Enter Body of Loop Execute [actions;] Evaluate test Again

25 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 25 Test is True while (test) { » actions; } other actions; Enter Body of Loop Execute [ actions; ] Evaluate test Again

26 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 26 You Get the Idea

27 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 27 Test is False while (test) { » actions; } other actions; Jump to other actions ; and Continue with the Rest of the Program

28 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 28 {actions;} walk(); pendown(); penup(); turnleft(); turnright(); You add the rest

29 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 29 Selection The if statement allows us to specify alternative actions depending upon a test

30 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 30 if (test) { } else { } if (pieinsight) { eatpie(); } else { walk(); } Selection

31 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 31 if inside a loop createpieeater(); randompies(20); while (clearahead) { if (pieinsight) { eatpie(); } else { walk(); }

32 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 32 Counting loops - for int i; createpieeater(); for (i=0; i<5; i++) { walk(); }

33 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 33 In Conclusion Problem Solving is a Skill – Riding a Bicycle – Swimming – Keeping Awake in Lectures It Cannot be Learned Quickly It Cannot be Learned without Practice Every Failure is Part of the Learning Process

34 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE Lecture Exercise 1 Draw the following grid

35 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE Trace out the following program createpieeater(); turnright(); pendown(); while (clearahead) { walk(); }

36 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE Lecture Exercise 1 Answer

37 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE Lecture Exercise 2 Write the program for

38 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE Lecture Exercise 2 Answer createpieeater(); int i; for (i=1 ; i<=4 ; i++) { while (clearahead) { walk(); } turnright(); }

39 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE Lecture Exercise 3 – spot the syntax error createpieeater(); int i; for (i=1, i<=4, i++) { while (clearahead) { walk() } turnright();

40 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 40 In Conclusion Programming Languages are Merciless – Syntax Matters – Semi Colons can be Dangerous – In Conclusion: }

41 www.hope.ac.uk Faculty of Sciences and Social Sciences HOPE 41 Questions? Next… – Problem Solving in your seminars More loops If statements – Next lecture on Algorithms – Setting of assessment next week


Download ppt "Faculty of Sciences and Social Sciences HOPE Structured Problem Solving An Introduction Stewart Blakeway 0151 291 3113."

Similar presentations


Ads by Google