Code Monkey home page Code Monkey logo

idnumber_check's Introduction

homework0

Examine a valid account number. Write a program that prompts the user to enter an account number. Display whether the number is valid or invalid according to the following situations. Design your program to your algorithm and methods. Account numbers follow certain patterns.

  1. An account number must have 16 characters. It must start with two capital letters but the first letter must always be lower than the second. (for example: AB, CH, AZ, etc.)
  2. Two digits after the letters must be prime numbers.
  3. For the next 12 digits: a) Double every second digit from right to left. If doubling of a digit results in a twodigit number, add up the two digits to get a single-digit number. b)Now add all single-digit numbers from Step a. 4 + 4 + 8 + 2 + 3 + 1 = 22 c) Add all digits in the odd places from right to left in the card number. 6 + 6 + 1 + 8 + 0 + 7 = 28 d) Sum the results from Step b and Step c. 22 + 28 = 50 e) If the result from Step d is divisible by 10, the account number is valid; otherwise,it is invalid. For example: The account number AC11576018412626 is a valid.

idnumber_check's People

Contributors

bthndmn12 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.