developing a solution getting past the panic of staring at a “blank sheet” of paper when solving...

29
Developing a Solution Getting past the panic of staring at a “blank sheet” of paper when solving a problem 1

Upload: baldwin-jordan

Post on 01-Jan-2016

218 views

Category:

Documents


3 download

TRANSCRIPT

Page 2: Developing a Solution Getting past the panic of staring at a “blank sheet” of paper when solving a problem 1

General Idea of This Lesson

Give you methodology

Example problems: “Find the optimum nozzle dimensions for …” “Solve for the optimum path for the robot …” “Find the range of temperatures adequate for …”

In EGR115, most tasks will be:

“Develop a software that solves……”

Page 3: Developing a Solution Getting past the panic of staring at a “blank sheet” of paper when solving a problem 1

General Terms

As a programmer, keep in mind there are 2 sides to a software The person who writes the software: the programmer The person who uses the software: the user , or client !

As you (student) develop a software, constantly jump back and forth between the two roles.

“The programmer should make the user’s life easy.”

3

Page 5: Developing a Solution Getting past the panic of staring at a “blank sheet” of paper when solving a problem 1

Step 1. State the problem

However the problem may seem, it is crucial to fully understand the problem, and clarify any doubts.

For example: Generate a software that “Solves the area of any triangle” What way would you go about doing this:

On Paper first

5

Page 8: Developing a Solution Getting past the panic of staring at a “blank sheet” of paper when solving a problem 1

Step 2. Identify the I/O

Remember the Von Neumann architecture? CPU + memory + inputs/outputs devices

The I/O diagram determines which input and output devices the software uses, as well as decide which inputs and output variables are used.

The I/O diagram is a first step to organizing the brainstorming.

8

Page 25: Developing a Solution Getting past the panic of staring at a “blank sheet” of paper when solving a problem 1

Some Other More Complex Examples (and yet, the I/O is not so complex)

2525

ATM MACHINEmoney Money Slotpin

Deposit/with-draw/transfer…

Touch Screen/ pin pad

Account numberCard

receiptReceipt Slot

Money Slot

money

Page 28: Developing a Solution Getting past the panic of staring at a “blank sheet” of paper when solving a problem 1

Remember: “SIMCT”(or: Small iPods Make Copying Tough)

1. S State the problem (clarify it if need be)

2. I Identify the Inputs and Outputs

3. M Manually solve the problem

4. C Computerize the solution1. Layout the algorithm

2. Provide the code that implements the algorithm

5. T test, Test, TEST!!

28

Page 29: Developing a Solution Getting past the panic of staring at a “blank sheet” of paper when solving a problem 1

1. S State the problem (clarify it if need be)

2. I Identify the Inputs and Outputs

3. M Manually solve the problem

4. C Computerize the solution1. Layout the algorithm

2. Provide the code that implements the algorithm

5. T Test, Test, TEST!!

Remember: “SIMCT”(or: Small iPods Make Copying Tough)

29

Note: I and M are usually mixed up. You obvioulsy need to brainstorm, solve the problem, find obstacles to fix, resolve it again to eventually zoom in on the correct inputs/outputs.. Spend the most time here before coding.