Sunday, December 27, 2009

Can someone help me in creating a flowchart using MS Visio?

I need to create a flowchart for a program that validates the contents of a file.





The file that is being validated contains daily sales data from a pet store.





Each record in the file contains credit card transaction information, consisting of an approval number and the amount of the charge.





The program should output the information from records whose approval number is lower than the previous record or if the amount of the transaction is negative.





Can someone help me, PLEASE!!!Can someone help me in creating a flowchart using MS Visio?
As we're limited to text here, can't help a lot with the actual production of the flowchart, but I can lay out your algorthym at least. If I interpet you correctly, the disqualifying criteria are either approval number out-of-sequence or transaction amount negative. Going on that basis:





1) Initialization:


a) Set lastApprovalNumber to low values


b) Set inputEOF to FALSE


2) MainProcess (while !inputEOF):


a) Set validRecord to TRUE


b) Read next input record


c) IF no more, set inputEOF to TRUE and bypass remaining loop steps


d) IF transactionTotal %26lt; zero OR recordApprovalNumber %26lt; lastApprovalNumber, set validRecord to FALSE


e) Set lastApprovalNumber to recordApprovalNumber


f) IF validRecord (do whatever processing appropriate)


ELSE (output invalid record as appropriate)


3) Termination (any needed wrapup functions)





Just be aware that a record flagged as a sequence error is not necessarily the record that's wrong. For example, in the sequence {1, 3, 7, 2, 9, 23}, the '2' record is the one that's incorrect and would be flagged appropriately. However, in the sequence {9, 1, 2, 7, 23}, the '1' record would be indentified as the one in error, but it's more probable that it's the '9' record that's incorrect.

No comments:

Post a Comment