Information Technology Reference
In-Depth Information
change is made the account file will have to be reread in update mode to see if anyone
else has that record. If so, the record cannot be updated at this time. If the record is
available, the program will then write the accoun t record with all the changes. Whether
this is done or the record is busy, the program will then return so that another account
number can be keyed.
This doesn't sound too difficult but it is more complex than described here. To
begin with, we don't want someone to enter characters into either name that are not
allowed there, such as $ or %. Thus we should try to eliminate this possibility and warn
the operator of this error with some kind of message. Fortunately by defining the account
balance as
signed decimal
we won't have to worry about what is keyed since any character that is not acceptable as
this type of field will not be allowed by the input statement. We can check for certain
characters in either name, but the user could enter “h-o-s-e-r-s” and that would be fine,
with no objection. We will assume that the operator knows what he is doing. In many
companies, that belief can be dangerous.
Most of the inquiry / update program will look familiar but there will be a few
new keywords and some of the logic may be troubling or puzzling or both. After going
through it, you should have a good grasp of what an update is all about. Assuming the
operator enters a valid account number of
391842091,
the new screen will look like the following:
Account number inquiry / update
Account number: 391842091
1. last name: Smith
2. first name: John
middle initial: L
street address: 3910 Main Street
city: East Aurora
state: NY
zip code: 14052
3. account balance: $27.89
key 1 (last name), 2 (first name), 3 (balance) or 0 (next)
Search WWH ::




Custom Search