| help This is my next Program and I would like some help to start coding it.
I am also new in programming.
A local bank has instituted a new credit system and would like to have account numbers that are self-checking in order to have some protection against fraud and clerical errors. They have devised a system a follows:
The account numbers will be nine digits long and the ninth digit(rightmost)can be calculated by either adding, subtracting, or multiplying all of the preceding digits and finfind the rightmost digit of the result. If the two righmost digits match, the account numbers is valid.
In the operation code(the first digit), 1 is addition, 2 is subtraction, and 3 is multiiplication. Any other digit in this position is incorrect.
Your job is to write a program that will check the validity of an account number that has been sent to the bank as part of its daily transaction.
INPUT: a nine-digit account number.
OUPUT: Echo print the input, followed by account status.
(Either VALID, INVALID, or OPERATION CODE ERROR)
EXAMPLE: 123456786
1+2+3+4+5+6+7+8=36
6 is the rightmost digit in both the account number and the
result of the operation. Therefore, the account number is
VALID.
EXAMPLE: 312131413
3*1*2*1*3*1*4*1=72
The righmost digit of the result of the operation is 2, but
the rightmost digit of the account number is 3. This account
number is INVALID. |