Make a flowchart of the program, using the pseudo code from Unit four Topic two as a guide. For your convinence you can access this pseudo-code through selecting the following;
Here is the code needed to complete IP4 assignment.
start
perform initialTasks( )
while endOfFiles = false
perform mainModule( )
endwhile
perform terminate( )
stop
initialTasks( )
declare variables
clientRecord
num clientID
char clientName
char clientAddress
char clientPhone
num clientTotal
serviceRecord
num serviceID
char serviceDate
char serviceType
num serviceTotal
boolean endOfFiles = false
open files
sort serviceFile on serviceID
giving transFIle
close serviceFile
open transFile
print prtHeader
perform readClient( )
perform readService( )
if clientID = 999
if serviceID = 999
endOfFiles = true
endif
endif
return
readService()
read serviceRecord
if EOF
serviceID=999
endif
return
readClient()
read clientRecord
if EOF
clientID=999
endif
return
mainModule( )
if clientID = serviceID
clientTotal = clientTotal + serviceTotal
perform readService( )
else
if serviceID > clientID
write clientRecord
print clientRecord
perform readClient( )
else
print error message
perform readService( )
endif
endif
if clientID = 999
if serviceID = 999
endOfFiles = true
endif
endif
return
terminate( )
close files
return