Modular Design - PowerPoint PPT Presentation

1 / 7
About This Presentation
Title:

Modular Design

Description:

... yearly interest rate and loan duration (in years) ... Get Duration. Get Interest Rate. Compute Monthly Payment. Compute Total Payment. Display Headings ... – PowerPoint PPT presentation

Number of Views:35
Avg rating:3.0/5.0
Slides: 8
Provided by: scie248
Learn more at: http://www.cs.uwyo.edu
Category:

less

Transcript and Presenter's Notes

Title: Modular Design


1
Modular Design
  • Top-Down Design

2
Top-Down Design
  • Design is represented by a hierarchy chart.
  • Break a problem into individual tasks or modules.
  • If a module is too complex, break it down into
    sub modules.
  • Transcribe the modules into pseudocode.
  • Code the modules using the three logical
    structures of sequences, decisions, and
    repetition.

3
Top-Down Design Criteria
  • The design should be easily readable and
    emphasize small module size.
  • Modules proceed from general to specific as you
    read down the chart.
  • The modules, as much as possible, should only
    perform a single well-defined task.
  • Modules should be as independent of each other as
    possible.

4
  • Write a financial program that displays the
    monthly payment and total payment on a loan given
    the loan amount, yearly interest rate and loan
    duration (in years). The formula used to
    calculate the monthly payment is (SM (M1)
    N)/( (M1)N)-1)
  • Where
  • M monthly interest rateN number of monthly
    paymentsS loan amount

5
Loan Program
Get Input
Make Calculations
Display Results
6
Loan Program
Get Input
Make Calculations
Display Results
Get Amount
Get Duration
Get Interest Rate
Display Headings
Display Amounts
Compute Monthly Payment
Compute Total Payment
7
Loan Program
Get Input
Make Calculations
Display Results
Get Amount
Get Duration
Get Interest Rate
Display Headings
Display Amounts
Compute Monthly Payment
Compute Total Payment
Compute Monthly Interest Rate
Compute Number of Months
Write a Comment
User Comments (0)
About PowerShow.com