Download presentation
Presentation is loading. Please wait.
Published byBaldwin Jordan Modified over 9 years ago
1
Developing a Solution Getting past the panic of staring at a “blank sheet” of paper when solving a problem 1
2
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……”
3
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
4
The 5 step process Follow these steps in order: 1. State the problem clearly 2. Identify the givens vs. the results wanted This will be referred as the I/O diagram 3. Manually solve the problem 4. Computerize the solution 5. Test, test, test!!! 4
5
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
6
Step 2. Identify the I/O What do you know about the problem? How do you want to solve it? 6 height base
7
Step 2. Identify the I/O What do you know about the problem? How do you want to solve it? 7 side 1 side 2 angle height base
8
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
9
General frame of an I/O diagram Arrows indicate and names each given and result Purple boxes indicate which devices are used 9 ? ? ? ? ? ? ? ?
10
General frame of an I/O diagram 10 INPUT SIDE ? ? ? ? ? ? ? ?
11
General frame of an I/O diagram 11 OUTPUT SIDE ? ? ? ? ? ? ? ?
12
Applied to the area of triangle 12 AREA OF TRIANGLE
13
Applied to the area of triangle 13 AREA OF TRIANGLE Sides 1 and 2 Angle Each arrow represents the INPUTS (=GIVENS)
14
Applied to the area of triangle 14 AREA OF TRIANGLE Sides 1 and 2 Angle External interface – What DEVICE is used to enter the values of the givens Keyboard Each arrow represents the INPUTS (=GIVENS)
15
Applied to the area of triangle 15 AREA OF TRIANGLE Sides 1 and 2 Angle Keyboard Each arrow represents the INPUTS (=GIVENS) area Each arrow represents the OUTPUTS (=RESULTS)
16
Applied to the area of triangle 16 AREA OF TRIANGLE Sides 1 and 2 Angle External interface – What DEVICE is used to see the results Keyboard Each arrow represents the INPUTS (=GIVENS) Screen area Each arrow represents the OUTPUTS (=RESULTS)
17
Applied to the area of triangle Final I/O diagram 17 AREA OF TRIANGLE Sides 1 and 2 Angle Keyboard Screen area
18
Same problem: Option 2 18 AREA OF TRIANGLE Sides 1 and 2 Angle Printer Different input/output devices area 18 Microphone
19
… or option 3 … 19 AREA OF TRIANGLE base height Screen area 19 Keyboard Different Inputs
20
Some Other More Complex Examples (and yet, the I/O is not so complex) 20 ATM MACHINE
21
Some Other More Complex Examples (and yet, the I/O is not so complex) 21 ATM MACHINE Account number Card
22
Some Other More Complex Examples (and yet, the I/O is not so complex) 22 ATM MACHINE pin Deposit/with- draw/transfer… Touch Screen/ pin pad Account number Card
23
Some Other More Complex Examples (and yet, the I/O is not so complex) 23 ATM MACHINE pin Deposit/with- draw/transfer… Touch Screen/ pin pad Account number Card Money Slot money
24
Some Other More Complex Examples (and yet, the I/O is not so complex) 24 ATM MACHINE money Money Slot pin Deposit/with- draw/transfer… Touch Screen/ pin pad Account number Card Money Slot money
25
Some Other More Complex Examples (and yet, the I/O is not so complex) 25 ATM MACHINE money Money Slot pin Deposit/with- draw/transfer… Touch Screen/ pin pad Account number Card receipt Receipt Slot Money Slot money
26
Step3. Manually Solve Problem Solving the area of a triangle is obvious Height = 3 in Base = 2 in Area = ½ * 2 * 3 = 3 in squared 26
27
Step 4 and Step 5 These steps actually involve owning a computer and starting to type ‘lines of code’. Realize that none of the steps before did. In short: Step 4 – Computerize the solution Step 5 – Test the software created
28
Remember: “SIMCT” (or: Small iPods Make Copying Tough) 1. SState the problem (clarify it if need be) 2. IIdentify the Inputs and Outputs 3. M Manually solve the problem 4. CComputerize the solution 1. Layout the algorithm 2. Provide the code that implements the algorithm 5. Ttest, Test, TEST!! 28
29
1. SState the problem (clarify it if need be) 2. IIdentify the Inputs and Outputs 3. MManually solve the problem 4. CComputerize the solution 1. Layout the algorithm 2. Provide the code that implements the algorithm 5. TTest, 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.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.