157,850 views
1 vote
1 vote
A sales transaction was coded with an invalid customer account code (XXX-XX-XXX rather than XXX-XXX-XXX). The error was not detected until the updating run when it was found that there was no such account to which the transaction could be posted. A control procedure that would serve as a preventive control for this situation would be:

User Zachary Dow
by
2.4k points

1 Answer

21 votes
21 votes

Answer:

a simple IF statement using Regex

Step-by-step explanation:

In any coding language, a good control procedure for this would be a simple IF statement using Regex. In the IF statement you can grab the account code and compare it to a regular expression that represents the correct format. IF the account code is in the correct format (matches the regular expression), then you go ahead and save the account code for use. Otherwise, you would output an error and ask for another account code. This will prevent the program from trying to use an account code that is not valid.

User Aednichols
by
3.4k points