Download presentation
Presentation is loading. Please wait.
Published byNathan Alexander Modified over 8 years ago
1
Initial Steps in Program Development [Using problem defined in Ch. 1 of Stern & Stern]
2
Define the Problem word problem (pg 16 in Stern & Stern): A software developer in a large company is assigned the task of calculating and printing weekly wages or gross pay for all non-salaried personnel. look for key nouns and verbs: A software developer in a large company is assigned the task of calculating and printing weekly wages or gross pay for all non-salaried personnel.
3
IPO chart for key elements InputProcessOutput Non-salaried employee record - Calculate weekly wages - Print weekly wages (weekly wage report)
4
Expand IPO chart (add detail as you go) InputProcessOutput (employee record:) Emp-name Emp-hours Emp-rate - Calculate wages = emp-hours * emp-rate - Print wages: put emp-name, emp-hours, emp-rate, wages on output line (weekly wage report:) Standard format report Name-out Hours-out Rate-out Wages-out
5
Determine record layout (input) Input Record Layout (employee-record) Field nameSizeData typedecimals? Employee-name-in Hours-worked-in Hourly-rate-in 20 2 3 alphanumeric numeric -- 0 2
6
Determine record layout (output) Output Record Layout (print-rec) Field nameSizeData typedecimals? Name-out Hours-out Rate-out Weekly-wages-out 20 2 4 6 alphanumeric numeric -- 0 2 (formatted) Note: Filler spaces and titles have been ignored. Use a printer spacing chart next.
7
Expand into an algorithm …either pseudocode… Start Open files for input and output Dowhile there are records Read an employee-record (at end of file, set a flag) Not at end [Process employee record for wages] clear the output record move input fields to output fields calculate wages = hours-worked * hourly-rate move wages to output field write out record [ ] End-read End-do Close input and output files Stop
8
...or a flowchart (see P0-structure.hierarchy.doc link from web page)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.