dr scott turner. why do you needed to develop problem solving skills? one definition of programming...

29
Dr Scott Turner

Upload: mervyn-harrison

Post on 12-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

Dr Scott Turner

Page 2: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

Why do you needed to develop problem solving skills? One definition of programming is it is

applied problem solving You have a problem (E.g Need a

program to calculate the area of the circle).

What needs to be done? What inputs and outputs are needed? How does what is entered produce the

right output?

Page 3: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

“…many students have almost no mathematical background and some even arrive with a built-in phobia against anything involving formulae or syntax.” Carter (2004)

Page 4: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

“Programming is a complex activity…. Problem Solving is not trivial and requires component skills including relativity; decision making; identification of the central issues; recognition of relationships, familiar situations and patterns; development of an algorithm and the translation of the algorithm into executable code. ” Beaumont and Fox (2003)

Page 5: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

Beaumont C and Fox C (2003) “LEARNING PROGRAMMING: ENHANCING QUALITY THROUGH PROBLEM-BASED LEARNING.” [online] 4th Annual conference of the LTSN Centre for Information and Computer Science Galway 26-28th August 2003 http://www.ics.ltsn.ac.uk/pub/conf2003/index.htm accessed on 16th October 2003

Carter C (2004) “Say it another way Sam: Different Learning Paths” [online] LTSN-ICS One Day Workshop on the Teaching of Programming university of Huddersfield 15th March 2004 http://www.ics.ltsn.ac.uk/pub/programming04/index.html accessed on: 16th July 2004.

Page 6: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

Mistakes

An expert is a man who has made all the mistakes which can be made in a very narrow field.

Niels Bohr

Page 7: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

Mistakes

Anyone who has never made a mistake has never tried anything new. Albert Einstein

Page 8: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

Simplicity

Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction. Albert Einstein

Page 9: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

Simplicity

Everything should be made as simple as possible, but not simpler. Albert Einstein

All quotes taken from:http://www.brainyquote.com/ Accessed on 18/9/2006

Page 10: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

How do this course split

Weeks 1-8 Problem Solving

Weeks 9-24 Java Programming

Page 11: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

Stepwise refinement

Take the problem and break it down in to smaller and smaller chunks that are now manageable.

Page 12: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

Basics

Problem statement Analysis Design Implementation Testing

Page 13: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

Analysis – Sample thoughts What does it have to do? What does it need? What rules/algorithms are needed? When testing what does it take to

prove it works? Can I break this down further?

Page 14: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

Things to remember

There is often more than one solution to a problem You can often solve a problem in many

different ways, that each have advantages and disadvantages.

Two heads are better than one Part of some problem solving techniques

can be as simple as discussing issues. For example: Why did you do that?

Page 15: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

Problem 1.1

Write a routine to calculate the area of the circle.

First pass Input Calculation Display

Page 16: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

Second pass Input

Input radius of the circle Calculation

Area=Pi x radius x radius Display

Display area on the screen

Page 17: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

Third pass Put a message of the screen telling the

user to enter the radius of the circle. Read in from the keyboard what the

radius of the circle is Calculation Area=Pi x radius x radius Display the following message on the

screen “The area of the circle is “ and display the result of the calculation on the screen

Page 18: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

Problem 1.2:

In groups of 2-3 write a routine for calculating the area of a rectangular room.

First pass Input Calculation Display

Page 19: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

What assumptions did you make? Did you assume that the

measurements of the room were already taken?

What units of measurement did you use?

What does area of the room mean? Area of the floor? Area of the floor and area of all the

walls?

Page 20: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

Problem 1.3

An Ant is in the corner of the a sqaure room. (taken orginally from: Vickers P (2009) How to Think Like a Programmer ISBN 978-84480-903-5 Cengage)

Goal: Is to get to a bowl of sugar in the opposite diagonal corner on the floor. What is the shortest route?

Restrictions: It can’t fly or be blown across the room

Page 21: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

Hints

The key to this problem is to re-arrange the problem.

Try flattening the walls.

Page 22: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

University of Minnesota – Five steps in problem solving Understand and isolate the problem Brainstorm for ideas to solve the

problem Design a solution that might work Test your solution to see if it will work Assess whether the solution is good

enough to do it See

http://cda.mrs.umn.edu/~fauxr/computing/problemsolve.html

Page 23: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

Understand and isolate the problem What does it take to succeed with a particular

problem? What is the vital information?

Identify the parts of the problems – analysis. What are the inputs and outputs?

Page 24: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

Understand and isolate the problem Identify the parts of the problems –

analysis. What are the inputs and outputs? What are the limitations? What are the rules?

Page 25: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

Brainstorm for ideas to solve the problem Note down all the solutions

Have solutions been used in similar way before?

Keep solutions that have common features . Two heads are better than one.

When all the solutions have been found weed-out less reasonable ones.

Can be solo or group activity.

Page 26: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

Design a solution that might work The design of a solution can be created using

diagrams, algorithms and other models. The main purposes of creating a design that can be viewed by others is to communicate the solution. Providing a diagram or algorithm of what you THINK is going on and is needed will provide others a chance to see what your thinking is.

Page 27: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

Test your solution to see if it will work Take the time to trace through your design

with some test information. Try more than one scenario. Try to find information that tests the borders. Choose some information that isn't supposed

to work and be certain that the design handles it.

Give your algorithm or diagram to another person.

 

Page 28: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

Assess whether the solution is good enough to do it Is this solution really worth doing? Would another solution be better for this

situation?

Page 29: Dr Scott Turner. Why do you needed to develop problem solving skills?  One definition of programming is it is applied problem solving  You have a problem

Problem 1.4

Write a routine that lets the user convert pounds Stirling into the Northampton dollar and display the results

What information do you need? What does the routine need to do?