Modular Design 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.
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.
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: (S*M* (M+1) N )/( (M+1) N )-1) Where M = monthly interest rate N = number of monthly payments S = loan amount
Loan Program Get InputMake Calculations Display Results
Loan Program Get InputMake Calculations Display Results Get Amount Get Duration Get Interest Rate Compute Monthly Payment Compute Total Payment Display Headings Display Amounts
Loan Program Get InputMake Calculations Display Results Get Amount Get Duration Get Interest Rate Compute Monthly Payment Compute Total Payment Display Headings Display Amounts Compute Monthly Interest Rate Compute Number of Months