problem solving with the sequential logic structure n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Problem Solving with the Sequential Logic Structure PowerPoint Presentation
Download Presentation
Problem Solving with the Sequential Logic Structure

Loading in 2 Seconds...

play fullscreen
1 / 22

Problem Solving with the Sequential Logic Structure - PowerPoint PPT Presentation


  • 765 Views
  • Uploaded on

Problem Solving with the Sequential Logic Structure. Chapter 5. Review. Recall that the: Algorithm: set of instructions telling the computer how to process a module in a solution. A flowchart: visual illustration of an algorithm. In this chapter you will learn how to:

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Problem Solving with the Sequential Logic Structure' - onella


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
review
Review
  • Recall that the:
    • Algorithm: set of instructions telling the computer how to process a module in a solution.
    • A flowchart: visual illustration of an algorithm.
  • In this chapter you will learn how to:
    • Write an algorithm for each module in a program.
    • Draw a flowchart to accompany in each algorithm.
slide5

Exit is used to end a subordinate module if there is no return value .

  • Return is used when the module is to be processed within an expression .

average = sum ( num1 , num2) / 2

sequential logic structure
Sequential Logic Structure
  • The most commonly used and the simplest logic structure .
  • all problem use the sequential structure .
  • most problem problems use it in conjunction with one or more of the other logic structure .
sequential logic structure1
Sequential Logic Structure
  • The form of the algorithm looks like this :

module name ( list of parameters)

1. instruction

2. instruction

3. …..

x x.End,Exit,or Return (variable )

example
Example:

The algorithm and flowchart to enter a name and age into computer and print it on the screen.

( )

Notice that the algorithm instructions are numbered starting with the first instruction after the name of module

solution development
solution development
  • The problem analysis chart.
  • The interactivity chart .
  • The IPO chart .
  • The coupling diagram and the data dictionary .
  • The algorithms .
  • The flowcharts .
    • The seventh step in solving the problem is to test the solution to catch any errors in logic or calculation .
the problem
The Problem
  • Marry smith is looking for the bank that will give the most return on her money over the next five years. She has $2,000 to put into a savings account.
  • The standard equation to calculate principal plus interest at the end of a period of time is:

Amount = p * (1+I/M)^(N*M)

12

the problem1
The Problem
  • Amount = p * (1+I/M)^(N*M)
  • p= principal ( amount of money to invest)
  • I = interest ( percentage rate the bank pays to the invested)
  • N = number of years ( time for which the principle is invested )
  • M = compound interval ( the number of times per year the interest is calculated and added to the principal )
data dictionary
Data Dictionary
  • in this problem all variables are local .
  • All coupling will be done through parameters .