1 / 21

Clearly Visual Basic: Programming with Visual Basic 2010 2 nd Edition

Clearly Visual Basic: Programming with Visual Basic 2010 2 nd Edition. Chapter 2 First You Need to Plan the Party (Problem-Solving Process). Objectives. After studying Chapter 2, you should be able to: Identify the output and input in a problem specification

cuyler
Download Presentation

Clearly Visual Basic: Programming with Visual Basic 2010 2 nd Edition

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. Clearly Visual Basic: Programming with Visual Basic 2010 2nd Edition Chapter 2 First You Need to Plan the Party (Problem-Solving Process)

  2. Objectives After studying Chapter 2, you should be able to: • Identify the output and input in a problem specification • Plan an algorithm using pseudocode and flowcharts • Desk-check an algorithm Clearly Visual Basic: Programming with Visual Basic 2010, 2nd Edition

  3. How Do Programmers Solve Problems? • You cannot solve a problem unless you understand it • You cannot understand a problem unless you analyze it • Most important components of any problem • Problem’s output and its input Clearly Visual Basic: Programming with Visual Basic 2010, 2nd Edition

  4. How Do Programmers Solve Problems? (cont’d.) Figure 2-1 Steps for solving a problem using a computer Clearly Visual Basic: Programming with Visual Basic 2010, 2nd Edition

  5. Step 1 – Analyze the Problem • Identify output • What does the user want to see printed on paper, displayed on the screen, or stored in a file? • Identify input • What information will the computer need to know to print, display, or store the output items? • Analysis step is most difficult problem-solving step Clearly Visual Basic: Programming with Visual Basic 2010, 2nd Edition

  6. Step 1 – Analyze the Problem (cont’d.) Figure 2-2 Problem specification for Addison Smith Clearly Visual Basic: Programming with Visual Basic 2010, 2nd Edition

  7. Step 1 – Analyze the Problem (cont’d.) Figure 2-3 Output and input items for the Addison Smith problem Clearly Visual Basic: Programming with Visual Basic 2010, 2nd Edition

  8. Step 1 – Analyze the Problem (cont’d.) Figure 2-4 Problem specification for Aiden Turner Clearly Visual Basic: Programming with Visual Basic 2010, 2nd Edition

  9. Step 1 – Analyze the Problem (cont’d.) Figure 2-5 Output and input items for the Aiden Turner problem Clearly Visual Basic: Programming with Visual Basic 2010, 2nd Edition

  10. Step 2 – Plan the Algorithm • Pseudocode • False code, not standardized • Cannot be understood by a computer • Used by programmers when planning an algorithm • Flowchart • Uses standardized symbols to visually depict an algorithm Clearly Visual Basic: Programming with Visual Basic 2010, 2nd Edition

  11. Step 2 – Plan the Algorithm (cont’d.) Figure 2-6 Output, input, and algorithm items for the Addison Smith problem Clearly Visual Basic: Programming with Visual Basic 2010, 2nd Edition

  12. Step 2 – Plan the Algorithm (cont’d.) • Flowchart symbols • Oval: start/stop symbol • Parallelogram: input/output symbol • Rectangle: process symbol • Flowlines • Connect symbols • Processing item • Intermediate value that algorithm uses when processing input into output Clearly Visual Basic: Programming with Visual Basic 2010, 2nd Edition

  13. Figure 2-7 Flowchart for the Addison Smith problem’s algorithm Clearly Visual Basic: Programming with Visual Basic 2010, 2nd Edition

  14. Figure 2-8 Output, input, and algorithm for the Aiden Turner problem Clearly Visual Basic: Programming with Visual Basic 2010, 2nd Edition

  15. Figure 2-9 A different solution to the Aiden Turner problem Clearly Visual Basic: Programming with Visual Basic 2010, 2nd Edition

  16. Figure 2-10 Flowchart for the algorithm shown in Figure 2-9 Clearly Visual Basic: Programming with Visual Basic 2010, 2nd Edition

  17. Step 3 – Desk-Check the Algorithm • Desk-checking • Also called hand-tracing • Follow each of the algorithm’s instructions by hand • Choose sample data for input values • Manually compute expected output values • Valid data • Data that algorithm is expecting user to enter • Invalid data • Data that algorithm is not expecting user to enter Clearly Visual Basic: Programming with Visual Basic 2010, 2nd Edition

  18. Figure 2-11 Addison Smith solution and desk-check table Clearly Visual Basic: Programming with Visual Basic 2010, 2nd Edition

  19. Figure 2-16 Aiden Turner solution and desk-check table Clearly Visual Basic: Programming with Visual Basic 2010, 2nd Edition

  20. Summary • First three steps in the problem-solving process • Analyze the problem • Plan the algorithm • Desk-check the algorithm • Programmers use tools to organize their thoughts • Pseudocode • Flowcharts Clearly Visual Basic: Programming with Visual Basic 2010, 2nd Edition

  21. Summary (cont’d.) • Algorithm • Enter data • Process data • Display, print, or store data • Calculation instructions in an algorithm • Specify what is to be calculated and how to perform calculation • After completing analysis and planning steps: • Programmer desk-checks algorithm Clearly Visual Basic: Programming with Visual Basic 2010, 2nd Edition

More Related