Skip to content

gtRZync/credit-card-validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Credit Card Validator (C++)

This is a C++ implementation of a credit card validator using Object-Oriented Programming (OOP) principles and Luhn's algorithm.

Features

  • Validates credit card numbers using the Luhn algorithm.
  • Implements the solution using OOP concepts like classes, methods, and encapsulation.

Luhn Algorithm

The Luhn algorithm is used to validate various identification numbers, especially credit card numbers. It works by performing a checksum to determine whether the card number is valid or not.

Installation

1. Clone the repository:

git clone https://github.com/gtRZync/credit-card-validator.git

2. Navigate into the project folder:

cd credit-card-validator

3. Build and run the program:

make run

This will automatically compile the source files and run the program. Make sure you have make and g++ installed on your system or modify the makefile to use your desired compiler.


Usage

  1. Input a credit card number when prompted.
  2. The program will output whether the card number is valid or invalid based on the Luhn algorithm.

Example

Enter credit card number: 4532015112830366
Credit card number is valid!

License

This project is licensed under the MIT License.

Potential Evolution

GUI version perhaps