Write a credit card validation program

Assignment Help JAVA Programming
Reference no: EM131588680

Write a Credit card validation program. Credit card numbers follow certain patterns. A credit card number must have between 13 and 16 digits.

It must start with
4 for Visa cards,
5 for Master cards,
37 for American Express cards, and
6 for Discover cards.
In 1954, Hans Luhn of IBM proposed an algorithm for validating credit card numbers. The algorithm is useful to determine whether a card number is entered correctly or
whether a credit card is scanned correctly by a scanner. Credit card numbers are generated following this validity check, commonly known as theLuhn check or the Mod 10 check.which can be described as follows :
1.. Double every second digit from right to left. If doubling of a digit results in a 2-digit number, add up the two digits to get a single-digit number.
Look at this 16 - digit number: 4 3 8 8 5 7 6 0 1 8 4 0 2 6 2 6
4 * 2 = 8
8 * 2 = 16 -> 1 + 6 = 7
5 * 2 = 10 -> 1 + 0 = 1
6 * 2 = 12 -> 1 + 2 = 3
1 * 2 = 2
4 * 2 = 8
2 * 2 = 4
2 * 2 = 4
2. Add all single-digit numbers from Step 1. In this case the sum is 37
3. Add all digits in the odd places from right to left in the card number, in this case 38
4. Sum the results from Step 2 & 3 , in this case, 37 + 38 = 75
E. Display if the number is valid or not.

Reference no: EM131588680

Questions Cloud

Why the lease meets the capital lease requirements : Please write a memo to your boss (me) discussing the reason why the lease meets the capital lease requirements
Discusses four types of perceptual distortions : Discusses four types of perceptual distortions- stereotyping, halo effects, selective perception, and projection. Define each of these and provide an example
Create a sexual harassment policy : Create a sexual harassment policy for your selected company to address a sexual harassment complaint.
Describe the types of computer hardware : For this essay, describe the types of computer hardware and software your employees will use, the type of network setup you will need between the two offices
Write a credit card validation program : Write a Credit card validation program. Credit card numbers follow certain patterns. A credit card number must have between 13 and 16 digits.
Compute shear and bending stresses in the beam : Immediately after construction the right support of the beam shown in Figure undergoes a settlement equal to ?.
Phase-requirement analysis : Descriptions of outputs/inputs/performance/security or controls H. Specific requirements, if any (interface, operational, resource, performance, etc.)
Prepare the journal entry farmers products should make : Prepare the journal entry Farmers Products should make in preparing its December 31, 2013, financial statements
Discuss differences between piaget and neo-piagetians : What are the main differences between Piaget and Neo-Piagetians. Also, please explain disequilibrium and the process of equilibration.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd