C# program credit card validation

  • Tình trạng Đã Đóng
  • Ngân sách $10 - $30 USD
  • Tổng Lượt Chào Giá 45

Mô Tả Dự Án

this is for rookie programming class

as basic as possible

write C Sharpe console app NO ARRAYs

simple console application

Credit card validation Problem. A credit card number must be between 13 and 16 digits. It must start with:

–4 for visa cards

–5 for mater cards

–37 for American express cards

–6 for discover cards

•Consider a credit card number 4380556218442727

•Step1: double every second digit from right to left. If doubling of a digit results in a two-digit number, add up the two digits to get a single-digit number.

•Step2: now add all the single digit numbers from step1

4 + 4 + 8 + 2 + 3 + 1 + 7 + 8

•Step3: add all digits in the odd places from right to left in the card number

7+ 7 + 4 + 8 + 2 + 5 + 0 + 3 = 36

•Step4: sum the results from step 2 and step 3

37 + 36 = 73

•Step 5: if the results from step 4 is divisible by 10, the card number is valid; otherwise, it is invalid. In this case, the card number is not valid – because 75 not divisible by 10. use modulus operator

Use these numbers to help test your code. Hint, these examples do not test all possibilities!

SAMPLE RUN:

Enter a credit card number as a long integer: 4321123200250

4321123200250 is invalid

SAMPLE RUN:

Enter a credit card number as a long integer: 4388576018410707

4388576018410707 is valid

Nhận báo giá miễn phí cho dự án tương tự
Các kỹ năng yêu cầu

Bạn muốn kiếm tiền?

  • Hãy đặt mức ngân sách và khung thời gian của bạn
  • Mô tả đề xuất của bạn
  • Nhận thanh toán cho công việc của bạn

Thuê những Freelancer đã đặt giá trong dự án này

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online