Question: PYTHON 3.6 Chapter 8 exercise 5 Charge Account Validation Design a program that asks the user to enter a charge account number. the program should

PYTHON 3.6

Chapter 8 exercise 5

Charge Account Validation

Design a program that asks the user to enter a charge account number. the program should determine whether the number is valid by comparing it to the following list of valid charge account numbers:

These numbers should be stored in an array. use the sequential search algorithm to locate the number enter by the user. if the number is in the array, the program should display a message indicating the number is VALID. if the number is not in the array, the program should display a message indicating the number is INVALID

Program Statement:

Complete Chapter 8 Programming Exercise 5, with the following modifications:

Create a data file, valid_numbers.txt, containing the valid charge account numbers as listed in the book.

Create a data file, possible_valid numbers, containing a list of possible valid numbers (such as those entered by the user). You will create this file. Include at least 10 numbers, with approximately half valid and half invalid.

Compare each charge account number from the file, possible valid numbers, to see if it is listed as a valid number in the file valid_numbers.txt.

Create an output file, results.txt which lists the possible valid numbers and the result of validity checking. Create a list of numbers, followed by "VALID", or "INVALID". Space and align neatly.

Place your name and student ID at the top of the output file.

The output should look similar to:

Checked Charge Card Number VALID/INVALID 1. 5658845 INVALID 2. 7771534 INVALID 3. 4581002 VALID

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!