Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[C++] These are bank numbers with 8 digits and the last (9th) being a check digit. The numbers read from left to right. each digit

[C++] These are bank numbers with 8 digits and the last (9th) being a check digit. The numbers read from left to right. each digit is multiplied by its weight and sum. the result of the sum should be the same as the check digit(10mod). the program should use a loop to run twice. once using a good bank number and once using an incorrect bank number. 103000648 Chase 103000846 Chase with a transposition error 103000703 Interbank 103001469 Kirkpatrick Bank 103002251 Citizens Bank of Edmond 103002521 Citizens Bank of Edmond with a transposition error 103002691 First Fidelity 103002795 First Commercial Bank with an error 103003632 Banc First 103003687 First Commercial Bank 103013062 " 103013101 " 103013266 PRIME BANK 1016 W Covell Road 103112594 RCB Edmond Road 103112976 Arvest 303085230 Allegiance Credit Union 303085829 Tinker Federal Credit Union 303087995 Mid First 300387995 Mid First with a transposition error 103900036 Bank of Oklahoma 081904808 Bank of America 2145 W Edmond Rd Spirit Bank 3823 S Boulevard Farmers & Merchants 121 E Waterloo Legacy 1289 E 15 Bank of Nichols Hills [c++] Sample Logic: read in a bank number write the bank number, and the multipliers compute the checksum loop 8 times using i as a control variable pick off the i'th digit ch = bank number[i] digit[i] = ch-48; multiply it by the appropriate weight print the product add the product to the subtotal save the subtotal in an array (in subtotal[i]) end loop loop 8 times printing the subtotals print the last subtotal computed compute the check digit print the check digit if the subtotal % 10 == the last digit then write 'the check code is valid' else write 'the check code is invalid' Sample output: - print these numbers - - don't print these words 1 0 3 0 0 0 6 4 8 bank number 7 3 9 7 3 9 7 3 multipliers 7 0 27 0 0 0 42 12 products 7 7 34 34 34 34 76 88 subtotals 88 sum 8 check digit the check code is valid

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Hands On Database

Authors: Steve Conger

1st Edition

013610827X, 978-0136108276

More Books

Students also viewed these Databases questions

Question

Define chart of accounts and identify the categories of accounts.

Answered: 1 week ago

Question

Has the priority order been provided by someone else?

Answered: 1 week ago