1 / 22

Introduction to Problem Solving Lecture

Introduction to Problem Solving Lecture. CSC 135 Brenda Wilson. Problem Solving. Algorithm - set of instructions for accomplishing a task unambiguous effective finite (except for continuous processing) Computer Program - algorithm suitable for execution on a computer.

kiril
Download Presentation

Introduction to Problem Solving Lecture

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to Problem SolvingLecture CSC 135 Brenda Wilson

  2. Problem Solving • Algorithm - set of instructions for accomplishing a task • unambiguous • effective • finite (except for continuous processing) • Computer Program - algorithm suitable for execution on a computer

  3. ANSI says you are a device that can perform substantial ... . What am I? Definition A machine that can accept data, process the data, at high speeds , and give the results in an acceptable form with option of saving data & results.

  4. Does not compute!! Figure the deductions Then tell me... What we have here is a failure to communicate...

  5. What does a computer understand??? 110001001110 Machine Language

  6. Compiler/ Interpreter Assembler Needs Translation!! • High-Level Languages • Pascal, C++,Ada • VisualBasic, Cobol, Fortran,etc. • Assembly Language • Machine Language

  7. Interpreter Vs. Compiler • Interpreter • translates & executes one line at a time • Compiler • translates entire program & then executes

  8. Executing a Compiled Program High Level Language Compile Object Module Build Load Module Execute

  9. Terms used to describe High Level Languages • Structured – vs. spaghetti code • Procedural – programmer driven • Event-Driven • Object-Oriented – class,attributes, etc. R.A.D.

  10. Beginning: Do You Understand? • How problem is presented: • Required Results • Given Info • Process • How Program is written: • Given Info • Perform Processing • Req.Results • Input-Process-Output

  11. Tools Used for Algorithm Development • I/O Chart -- to analyze input & output • I O Gross Pay Deductions Net Pay Names Hrly Rates Hours Wrkd

  12. Tools Used for Algorithm Development Structure Chart - to show major tasks & subtasks

  13. Module In Out Tools Used for Algorithm Development • Top Down Design: Use pseudocode or flowchart (to show how each module works) • Module Interface Table : to show how each module shares data with other modules in the program

  14. Planning an OOED application – TOE chart

  15. Sender (Programmer) good overall picture good generalizing terrible at details slow!!! Receiver (Computer) good at details fast!!! terrible at overall picture terrible at new situations & inference Programming Language : set of notations & rules for combining notations to communicate algorithms

  16. Programming Languages • Syntax - set of formal rules determining valid constructions • Semantics - rules determining precise meaning of valid constructions in the language • “Bug”

  17. Proper Grammar Whoops!! Should be a quotation not apostrophe! (Ada) Put (“Enter your name’); lblArea.caption = txtLngth.text*txtWidth.txt Whoops!! Misspelled ‘text’! (VBasic) SYNTAX...

  18. What is meant?? The chicken is ready to eat. SEMANTICS...

  19. Computer Operations • Perform arithmetic • Compare 2 pieces of information & take alternative actions • Receive & give out information • Repeat any group of these operations • Save any information for later use

  20. 5 Operations of the Computer…examples in different languages

  21. Fundamental Control Structures In Programming

  22. Challenge: An English-speaking person from Guyana, S.A. has just come to visit at your house for a few days. This person has never used a cordless phone (maybe never even used a telephone at all!!). Write down instructions for this visitor to follow to make a phone call when he/she is alone in the house. Try to not assume any prior knowledge and try to think of every thing that could happen when the person tries to make a call. (example…is there a dial tone, if not—what to do!)

More Related