Question: Write a program that verifies cheques deposited into an ATM. Each cheque has an amount and a written amount. The OCR software will read the
Write a program that verifies cheques deposited into an ATM. Each cheque has an amount and a written amount. The OCR software will read the hand-written or printed amounts and convert them into text, you are to then analyze the text to make sure the two amounts match.
For example on the following cheques the OCR software would return the text shown below:
Beths Flower Wholesale $***150.25 One-hundred fifty-four dollars and 25/100**********************
Chris Garden Supplies $***235.88 Two-hundred thirty-five dollars and 88/100*********************
Cathys Landscaping $****50.25 Fifty dollars and 25/100***************************************
1)Your program should input two lines from the user and continue analyzing the cheques until the user types exit on the 1st input line.
2) Your program should work for ALL amounts from $0.01 to $999.99.
Additional comments:
- The numeric amounts will NOT have commas (e.g. $5421.23 NOT $5,421.33)
- The word description MAY or MAY NOT include a - between the words
- The word and is optional between the dollar amount and cent amount in the word description
- Sometimes people will write xx/100 in the word description to indicate 0 cents.
Sample run (user input is shown in Bold Underline):
Enter the 1st line of the cheque to deposit (exit to quit): Freds Pennies $***0.01
Enter the 2nd line of the cheque: 01/100*************************************************
Numeric amount and word amount match!
Cheque amount deposited is $0.01
Enter the 1st line of the next cheque to deposit(exit to quit): The Big Apple $*****213.55
Enter the 2nd line of the cheque: Two Thirteen Hundred 55/100****************************
ERROR: numeric amount and word amount DON'T MATCH.
Auto Deposit rejected.
Enter the 1st line of the next cheque to deposit(exit to quit): ATV Adventures
Enter the 2nd line of the cheque: Five Hundred Four Hundred Ten 00/100
ERROR: numeric amount and word amount DON'T MATCH.
Auto Deposit rejected.
Enter the 1st line of the next cheque to deposit(exit to quit): Joshua Climbing Adventures $***895.00
Enter the 2nd line of the cheque: Eight Hundred
ERROR: numeric amount and word amount DON'T MATCH.
Auto Deposit rejected.
Enter the 1st line of the next cheque to deposit(exit to quit): exit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
