Write a program to process an input j?le where data in j?le

Assignment Help Python Programming
Reference no: EM132355701

1. Write a program to process an input J?le where data inthe J?le is individual lines of credit card numbers {fake numbers, of course]. Your program must indicate if each credit card number is a valid number based on the J?sllowing criteria:

a. First digit must be either a 3, 4, 5, or 15

b. You mayimust assume that all credit card numbers are 10 digits long (again, these are fake numbers],

and using this assumption, start with the leftmost digit, double every second digit from left to right and

add those values together

For example, iftbe credit card number is: "16612346!

You would add the following: 3+12+2+?+12, which is a total of 4!]

c. Again using the assumption that there are It] digits, starting with the second digit, simply add every

second digit from left to right

For example, iftbe credit card number is: "16612346!

You would add the following: ?+15r+2+4+4, which is a total of lti

d. Sumthe results from step h &c

e. Ifthe result from step e is evenly divisible by ID, then the credit card number is valid. You do NOT lmow how many lines of data are in the file, therefore you must use a sentinel-control loop to process the data. The end oftbe datawill he indicatedby a credit cardnumberof all zeroes. Print a "neat and tidy" table {see sample rim] as you read through the file indicating whether each credit card is valid or invalid based on these criteria.

2. Function Requirements You must have three flmctions for tasks a, h & c listed above. They must each be value-returning functions. There must also he a main? flmction containing your sentinel-control loop. Other functions are allowed.

Reference no: EM132355701

Questions Cloud

What is the projects mirr : If the Present Value of all estimated futures costs of a 4 year new investment project is 960, and the future value of all expected profits
What is vogt required rate of return : Vogt Corporation has a Beta of 1.4. The U.S. government T-Bill is expected to yield 0.05, and the S&P 500 is expected to yield 0.13 in the near future.
What is the initial cash outflow of project : The tax rate is 35% and the required rate of return is 14%. What is the initial cash outflow of this project?
Describe the yield curve and how it is constructed : Describe the yield curve and how it is constructed. What theories best explain the changes in the yield curve?
Write a program to process an input j?le where data in j?le : Write a program to process an input J?le where data in the J?le is individual lines of credit card numbers.Your program must indicate.
Advantages and disadvantages of a purchase : What are the advantages and disadvantages of a purchase of assets from the perspectives of the buyer and the seller?
Time at present residence : A finance company that lends to "high-risk" automobile buyers, finds the following variables important in classifying default probabilities
Smo has a four-for-seven reverse stock split : SMO has a four-for-seven reverse stock split? Determine the new number of shares outstanding in parts (a) through (d). Please show work.
Determine the air to fuel ratio on a mass basis : Poplar has a dry, ash-free composition of 51.98%C, 6.30%H, 41.72%O, and negligible N. Determine the air to fuel ratio on a mass basis

Reviews

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

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