BME303_lecture11

# BME303_lecture11 - BME303 Intro to Computing Chapter 6...

This preview shows pages 1–8. Sign up to view the full content.

BME303 Intro. to Computing 1 Chapter 6: Programming Methodologies for creating computer programs that perform a desired function. 1. Problem Solving How do we figure out what to tell the computer to do? Convert problem statement into algorithm, using stepwise refinement . Convert algorithm into LC-3 machine instructions. 2. Debugging How do we figure out why it didn’t work? Examining registers and memory, setting breakpoints, etc. Time spent on the first can reduce time spent on the second!

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
BME303 Intro. to Computing 2 Stepwise Refinement •Also known as systematic decomposition . •Start with problem statement: “We wish to count the number of occurrences of a character in a file. The character in question is to be input from the keyboard; the result is to be displayed on the monitor.” •Decompose task into a few simpler subtasks . •Decompose each subtask into smaller subtasks , and these into even smaller subtasks , etc. ... until you get to the machine instruction level.
BME303 Intro. to Computing 3 Problem Statement •Because problem statements are written in English, they are sometimes ambiguous and/or incomplete. – Where is “file” located? How big is it, or how do I know when I’ve reached the end? – How should final count be printed? A decimal number? – If the character is a letter, should I count both upper-case and lower-case occurrences? •How do you resolve these issues? – Ask the person who wants the problem solved, or – Make a decision and document it.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
BME303 Intro. to Computing 5 Which construct? • As long as there is money in my bank account, keep spending it… Iterative Money in account spend True False

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
BME303 Intro. to Computing 6 Which construct? • A+B+C • A·B·C A+B (A+B)+C A*B (A*B)*C
7 Which construct? • Use credit card for purchases above \$100,

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 01/24/2010 for the course BME 303 taught by Professor Ren during the Fall '08 term at University of Texas.

### Page1 / 27

BME303_lecture11 - BME303 Intro to Computing Chapter 6...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online