Morteza Kashi
A program which specifies if a Credit Card is valid or not:
A credit card is evaluated by its number. Here, a credit card is valid if the product of its digits is divisible by the
sum if its digits and it consists of 9 digits.
As you can see this program should manage to separate digits to calculate the sum and the product of the
digits. This simple program teaches you how to take advantage of a while loop and mod operation.
The program prompts user to enter an 9-difit integer number as a credit card number. Then it specifies if the
credit card is valid or not by giving an appropriate message. If the entered number is not 9-digit-integer, the
program gives an appropriate message and prompts user to enter a 9-digit credit card number. Users may enter
999999999 to get rid of the execution of the program.
The output of the program is sent to the file named "output.txt" on your C drive as it is designed in the
program.
Please find my C++ code for this program by clicking on the following link:
Please click on the following link, should you want to see the execution of the program. To do that, Save the file "Credit.exe" on your desktop or somewhere else on your computer. Then, double click on it to see the execution of the program.
Please contact me by clicking HERE and filling out the coming simple form, should you have any question about this program.