Starting from the rightmost digit

Assignment Help Business Management
Reference no: EM131711151

The last digit of a credit card number is the "check digit" that protects against errors. For simplicity we will use credit cards with just 8 digits instead of 16. The user will input the 8 digit credit card number as a string and you will convert it to a list using the list() function. You need to validate the length of the string entered. If it is less than or greater than 8 characters, ask for another string. Validate the credit card number that you receive according to the following rules:

  1. Starting from the rightmost digit, form the sum of every other digit - for example, if the credit card number is 43589795 then you form the sum 5 + 7 + 8 + 3 = 23.
  2. Double each of the digits that were not included in the preceding step. Add all digits of the resulting numbers. For example, with the number given above, doubling the digits starting with the next-to-last one, yields 18 18 10 and 8. Adding all the digits in these values results 1 + 8 + 1 + 8 + 1 + 0 + 8 = 27.
  3. Add the sums of the two preceding steps. If the last digit of the result is 0, the number is valid. In the example, 23+ 27 = 50 so the number is valid.

Reference no: EM131711151

Questions Cloud

Discuss activities do for mental, emotional health : what they are missing out on by spending so much time with these everyday "outlets." What might they be doing instead and what might those other activities
Current string into a new string : At each stage of the game the user may apply one of the following rules to change their current string into a new string. use python
Provides polaris the greatest cost advantage : Which location provides Polaris the greatest cost advantage? Calculate the NPV of the three locations using a 10% discount rate.
Provide substantiated data about social media for business : Your business partner has just returned from a conference in which social media was promoted for communicating with business customers.
Starting from the rightmost digit : Starting from the rightmost digit, form the sum of every other digit - for example, if the credit card number is 43589795 then you form the sum.
Many of the ancient stories that we have read feature : Many of the ancient stories that we have read feature miracles, stupendous events or activities that we would normally consider beyond the reach of mortals
Explain the core principles of information assurance : Compare and contrast the core principles of information assurance and prioritize in the order each in your own opinion (Support your opinion).
What type of visual aids to use for a particular situation : What factors need to be taken into consideration when determining what type of visual aids to use for a particular situation
Telecommunication applications and services : Discuss the following telecommunication applications and services: (i) Caller ID, (ii) Automatic Call Distribution, (iii) Automated Attendance

Reviews

Write a Review

Business Management Questions & Answers

  Pros and cons of a unionized environment

What do you see as the pros and cons of a unionized environment in a health care facility? How can the right to collective bargaining by employees and the mandate to provide care to patients be reconciled?

  External factors

External Factors

  Aspects of nonverbal communication

Then focus on one or two aspects of nonverbal communication (e.g. eye-contact, personal space, or physical appearance).

  Discuss the role of corporate social responsibility

Discuss the role of corporate social responsibility (CSR) towards the stakeholders. Critically evaluate the organisation applying the roles of CSR.

  Relationship a partnership for a term

1. Was this relationship a partnership for a term or a partnership at will? 2. Did Manny have the authority to hire additional laborers to work at the ranch after his injury? Why or why not?

  Participative or democratic leadership styles

Which do you favor and does that leadership style work in all realms of your life

  A manufacturing company is faced with a financial and human

A manufacturing company is faced with a financial and human resources dilemma. It is losing market share and can no longer compete by selling its products at the same price points as overseas manufacturers

  Public health intervention for your final project

Design the Public Health Intervention for your Final Project. Using the guidelines in the CDC Evaluating Public Health Programs manual's Steps 1 and 2, design a basic Logic Model using the Worksheet

  Servant leaderships impact on resultsconduct research on

servant leaderships impact on resultsconduct research on the topic of impact of servant leadership on results. find two

  Showing the number of messages

In a data system A is the number of digits per message, B is the hashcode generated for each message, where A>B. Derive an expression showing the number of messages that will have the same hashcode.

  Operational issues in small business administration

Operational issues in small business administration are never ease for small business owners. No matter how hard you try

  Federal funds who commit fraud

As you saw in the text, "agents" of state entities that receive federal funds who commit fraud or bribery violate the federal program fraud statute, 18 U.S.C.A. § 666.

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