90 likes | 105 Views
This document provides a structured approach to developing a tuition billing program, including specifications, file descriptions, report layout, and processing requirements.
E N D
Methodology for Program Development • Tuition billing program • Specs • File descriptions • Report layout • Processing requirement • $200/cr • $25 union dues if a member (“Y” in that column) • Activity Fee based on the number of credits taken • Scholarship money • Print out report
CREDITS UNION MEMBER INITIALS SCHOLARSHIP STUDENT NAME LAST GPA 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 Figure 3.1 Record Layout & Report Format for Tuition Billing Program
Structured Design • Identification of tasks • Development of hierarchy chart • Must provide for every function • Evaluating the hierarchy chart • Completeness • Can’t break down any further • Functionality • Each module has a single function • Span of control
ANY COBOL PROGRAM INITIALIZATION PROCESSING TERMINATION Figure 3.2 Overall COBOL Hierarchy Chart
4th Level Processing Requirements 3a(1) Compute tuition 3a(2) Compute union fee 3a(3) Compute activity fee 3a(4) Compute scholarship Figure 3.3c Hierarchy Chart for Tuition Billing Program PREPARETUITIONREPORT WRITEHEADINGLINE READSTUDENTFILE PROCESSSTUDENTRECORD WRITEUNIVERSITYTOTALS COMPUTEINDIVIDUALBILL INCREMENTUNIVERSITYTOTALS WRITEDETAILLINE READSTUDENTFILE COMPUTETUITION COMPUTEUNIONFEE COMPUTEACTIVITYFEE COMPTUESCHOLARSHIP (c) Complete Hierarchy Chart (Levels 1-4)
Structured Programming • Three logic structures • Sequence • Sequentially run instructions • Selection • If … Then…Else • Iteration • Do … While • Extension of the basic structure (case) • Many if … then • One entry point/one exit point • Sufficiency of the basic structure • Any logic can be formed from these above
Open filesWrite heading line(s)Read STUDENT-FILE at end indicate no more dataDO WHILE data remains Compute tuition = 200 * credits IF union member union fee = $25 ELSE union fee = 0 ENDIF DO CASE CASE credits <= 6 Activity fee = 25 CASE credits > 6 and <= 12 Activity fee = 50 CASE credits > 12 Activity fee = 75 ENDCASE IF gpa > 2.5 Scholarship = Scholarship amount ELSE (no scholarship) Scholarship = 0 ENDIF Compute bill = Tuition + Union fee + Activity fee - Scholarship Increment university totals Write detail line Read STUDENT-FILE at end indicate no more dataENDDOWrite university totalsClose filesStop run Figure 3.8 Pseudocode for Tuition Billing Program (b) Detailed pseudocode
Top-Down Testing • Testing each module you code in • Evaluation of Program logic • Program stubs • Continuous Testing
Summary • Specs • Design • Identify each task to be done • Hierarchy Chart • Logic • One entry & one exit point • Pseudocode • Testing as you go