Presentation is loading. Please wait.

Presentation is loading. Please wait.

Developing a Solution How to create the computer-based solution for a real-world problem. 1.

Similar presentations


Presentation on theme: "Developing a Solution How to create the computer-based solution for a real-world problem. 1."— Presentation transcript:

1 Developing a Solution How to create the computer-based solution for a real-world 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 program that ……”

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 (aka client) As you (the student) develop software, you will constantly jump back and forth between the two roles. Your goal as a programmer: “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 easy the problem may seem, it is crucial to fully understand the problem, and clarify details. It can help to put the problem in writing. For example: Write a program that “Computes the area of a triangle” This might bring up questions – like “what do I know about the triangle?” 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 COMPUTE THE AREA OF TRIANGLE

13 Applied to the area of triangle 13 COMPUTE THE 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 COMPUTE THE 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 COMPUTE THE 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 COMPUTE THE AREA OF TRIANGLE Sides 1 and 2 Angle Keyboard Screen area

18 Same problem: Option 2 18 COMPUTE THE AREA OF TRIANGLE Sides 1 and 2 Angle Printer Different input/output devices area 18 Microphone

19 … or option 3 … 19 COMPUTE THE 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 sometimes reversed. You may need to decide what method you will use to solve the problem before you can determine what inputs are needed and outputs will be provided. In fact, sometimes the problem being solved gets changed…


Download ppt "Developing a Solution How to create the computer-based solution for a real-world problem. 1."

Similar presentations


Ads by Google