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

  Communication issues for management in organizations

Identify and briefly explain five communication issues for management in today's organizations.

  Imagination and creativity combined with solid marketing

Imagination and creativity combined with solid marketing concepts will be the basic framework for your report. They will be relying on you for all of the details to make this product successful. They are well funded and ready to bring this product to..

  Most fit the behavior of an accounting firm

Name the generic strategy you believe to most fit the behavior of an accounting firm (consult text and research for definition of terms). Explain your answer. Is this strategy choice effective? Why or why not?

  What is the purpose of ratio analysis

What is financial statement analysis?-  What is the purpose of ratio analysis?- What are two ratios that measure profitability?

  Part of an international trade agreement

Suppose that, as part of an international trade agreement, the U.S. government reduces the tariff on imported coffee. Will this affect the supply or the demand for coffee? Why? Which determinant of demand or supply is being affected? Show graphica..

  Linearity index

Given the following figures for a week, the linearity index is about:

  Data protection strictly limits how database information

The European Community's Directive on Data Protection strictly limits how database information is used and who has access to it.

  High failure rate for implementations

Explain why there is such a high failure rate for implementations involving enterprise applications, business process reengineering, and mergers and acquisition

  Bureau of labor statistics to question consumers

The Bureau of Labor Statistics fields the Consumer Expenditure Survey to find out about consumer expenditures and income. (1) Why is it so important for the Bureau of Labor Statistics to question consumers about their expenditures?

  Prepare a memo to your boss at jetblue airlines

Why do you think that CI is so hot in today's environment?  -  Prepare a memo to your boss at JetBlue Airlines and outline why the organization needs a CI unit.

  The role of innovation in executing change strategies

The business environment is continuously evolving with the integration of new management trends developed to create opportunity and respond to challenges. Innovation often challenges the status quo of organizations and change agents in an organiza..

  Work out the total output per day

a. Work out the total output per day for the entrepreneurs? b. Who has the absolute advantage in producing hats & shoes per hour c. Who has the comparative advantage in producing Hats?

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