Reference no: EM13945576
The Unit 4 Topic 2 Presentation contains pseudo-code for a program which processes a client file (the master file) and a service file (the transaction file) by updating the clientTotal field in the client file according to the serviceTotal field in the service file.
Create a flowchart of the program, using the pseudo-code from Unit 4 Topic 2 as a guide. For your convinence you can access this pseudo-code by 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