Ok. This is my HW and I am kind of lost. I appreciate if you can help me:
Credit card companies use built-in "checksums" as added security measures when creating the account numbers on credit cards. This means that there are only certain valid credit card numbers, and validity can instantly be detected by using an algorithm that may involve adding up parts of the numbers or performing other checks.
In this assignment, you will implement a security algorithm on a credit card number, and your program will indicate whether or not the card number is valid, according to the security check. Note that this algorithm is purely made-up; don't try to use it to create fake credit card numbers!
In your program, you must prompt the user to input a credit card number in the form ####-####-#### as a String, including the dashes. You can assume that the input is correctly formatted, but if you add code to check for correct formatting and terminate if there is an error, you will receive 5 points extra credit.
Your program must then check that the credit card number conforms to the following rules:
The first digit must be a 4.
The fourth digit must be one greater than the fifth digit
The product of the first, fifth, and ninth digits must be 24
The sum of all digits must be evenly divisible by 4
The sum of the first four digits must be one less than the sum of the last four digits
If you treat the first two digits as a two-digit number, and the seventh and eight digits as a two digit number, their sum must be 100.