Assume you are working as a developer in a bank, and you have been asked to develop a program to validate credit card numbers. Assume also that each credit card number consists of 8 digits. The following method is used to verify that the credit is valid or not: - Starting from the rightmost digit, form the sum of every other digit. For instance, if the credit card number is 43589795, then you form the sum 5 + 7 + 8 + 3 = 23. - Double each of the digits that were not included in the preceding step. Add all digits of the resulting numbers. Considering for example the above credit card number 43589795, doubling the digits starting from the next-to-last one, yields 18 18 10 8. Adding all digits in these values yields 1 + 8 + 1 + 8 + 1 + 0 + 8 = 27 - Add the sum of the two preceding steps. If the last digit of the resulting sum is 0, the credit card number is valid; otherwise, it is invalid. In our case, 23 + 27 = 50, so the number is valid. Write an Algorithm and Flowchart draw.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Assume you are working as a developer in a bank, and you have been asked to develop a program
to validate credit card numbers. Assume also that each credit card number consists of 8 digits. The
following method is used to verify that the credit is valid or not:


- Starting from the rightmost digit, form the sum of every other digit. For instance, if the
credit card number is 43589795, then you form the sum 5 + 7 + 8 + 3 = 23.


- Double each of the digits that were not included in the preceding step. Add all digits of the
resulting numbers. Considering for example the above credit card number 43589795,
doubling the digits starting from the next-to-last one, yields 18 18 10 8. Adding all digits
in these values yields 1 + 8 + 1 + 8 + 1 + 0 + 8 = 27


- Add the sum of the two preceding steps. If the last digit of the resulting sum is 0, the credit
card number is valid; otherwise, it is invalid. In our case, 23 + 27 = 50, so the number is
valid.

 

Write an Algorithm and Flowchart draw.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Program on Numbers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education