Clearly visual basic programming with visual basic 2010 2 nd edition
This presentation is the property of its rightful owner.
Sponsored Links
1 / 21

Clearly Visual Basic: Programming with Visual Basic 2010 2 nd Edition PowerPoint PPT Presentation


  • 55 Views
  • Uploaded on
  • Presentation posted in: General

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

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Clearly visual basic programming with visual basic 2010 2 nd edition

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

Chapter 2 First You Need to Plan the Party (Problem-Solving Process)


Objectives

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


How do programmers solve problems

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


How do programmers solve problems cont d

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


Step 1 analyze the problem

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


Step 1 analyze the problem cont d

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


Step 1 analyze the problem cont d1

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


Step 1 analyze the problem cont d2

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


Step 1 analyze the problem cont d3

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


Step 2 plan the algorithm

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


Step 2 plan the algorithm cont d

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


Step 2 plan the algorithm cont d1

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


Clearly visual basic programming with visual basic 2010 2 nd edition

Figure 2-7 Flowchart for the Addison Smith problem’s algorithm

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


Clearly visual basic programming with visual basic 2010 2 nd edition

Figure 2-8 Output, input, and algorithm for the Aiden Turner problem

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


Clearly visual basic programming with visual basic 2010 2 nd edition

Figure 2-9 A different solution to the Aiden Turner problem

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


Clearly visual basic programming with visual basic 2010 2 nd edition

Figure 2-10 Flowchart for the algorithm shown in Figure 2-9

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


Step 3 desk check the algorithm

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


Clearly visual basic programming with visual basic 2010 2 nd edition

Figure 2-11 Addison Smith solution and desk-check table

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


Clearly visual basic programming with visual basic 2010 2 nd edition

Figure 2-16 Aiden Turner solution and desk-check table

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


Summary

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


Summary cont d

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


  • Login