{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Be sure to follow all the steps of the design recipe

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: nstructions in the style guide. Specifically, your solutions should be placed in files a05qY.py, where Y is a value from 1 to 4. • Download the interface file from the course Web page. • For full marks, it is not sufficient to have a correct program. Be sure to follow all the steps of the design recipe, including the definition of constants and helper functions where appropriate. • Read each question carefully for restrictions. Test data for all questions will always meet the stated assumptions for consumed values. • Assignments will not be accepted through email. Course staff will not debug code emailed to them. Coverage: Module 5 • • • 1. Credit card numbers often have a built ­in check digit for validity, that is, one digit is defined in relation to all the other digits. For example, the last digit is often chosen to be the remainder when the sum of all the other digits is divided by a small prime number. Complete a Python function credit_card_generator that consumes a positive 4 ­digit integer between 1000 and 9999 (called four_digit), and produces a 5 ­digit integer by appending a digit, r, to the end of four_digit, where r is the remainder when the sum of all the digits in four_digit is divided by 7. For example, credit_card_generator(2345) => 23450 and credit_card_generator(5003) => 50031. 2. Given a valid date (year, month, day), the Gaussian formula given below determines on which day of the week (where 0=Sunday, 1=Monday, 2=Tuesday, etc.) the specified...
View Full Document

{[ snackBarMessage ]}