Write a python program that reads the contents of the data

Assignment Help Python Programming
Reference no: EM13951065

Task

In the Resources section of the Interact2 subject website there is a data file called cars.txt. This file contains details of a valid car rego numbers. Each rego number is a six-alphanumeric such as A1B2C3. (Note: Two records in the file have intentionally been "corrupted" - for testing purposes.)

Design an algorithm and use it to write a Python program that reads the contents of the data file into a list. The program should then loop, to allow a user to check various numbers against those stored in the list. The loop should terminate when an "empty" input occurs - i.e. when the user presses the [Enter] key on its own. (Obviously this last entry should NOT be checked against the list!) If the rego number input matches an element somewhere in the list, the program should display the number together with a message saying that it IS a valid rego number. If the number input does not match any element in the list, then the program should display the number and a message saying that it IS NOT a valid rego number.

Notes:

The algorithm should be written in pseudocode (structured English).

The records read from the data file should be checked and NOT placed into the list if they are something other than a 6-alphanumeric. (Display a sensible message if the file is found to have corrupt records in it.)

The numbers entered by the user should be checked to ensure they are valid alphanumeric (as distinct from valid rego numbers) and not processed further if they are not.

Your programs should use one or more functions where sensible, and be documented fully.

Use exceptions where necessary.

Specify 3 sets of test data that will demonstrate the correct ‘normal' operation of your program. Show your test data in a table as you have done in earlier assignments.

Run your program using the test data you have selected and save the output produced in a single text file.

Submit:

1. Your algorithm and test data table.
2. The table recording your chosen test data.
3. Source code for your Python implementation.
4. Output test file demonstrating the results of using the test data.
5. Contents of the data file cars.txt read by the program.

It is important that the output listings are not edited in any way.

Attachment:- Cars.txt

Reference no: EM13951065

Questions Cloud

The after tax cost of par value corporation : The after tax cost of Par Value Corporation's outstanding bond is 6.6%. If the firm is in the 34% tax bracket, what is the before tax cost (yield) of that debt?
Multiple distribution centers : In general, what are the qualitative pros and cons for domestic sales of having multiple distribution centers and shipping locations in the United States?
What do you understand by communication : What do you understand by Communication? Draw the Basic Block Diagram of Communication System.
Identify causes of the great depression : From the scenario, identify at least two (2) causes of the Great Depression. Review the materials in Instructor Insights, including Hoover's criticism of Roosevelt's policies
Write a python program that reads the contents of the data : Design an algorithm and use it to write a Python program that reads the contents of the data file into a list. The program should then loop, to allow a user to check various numbers against those stored in the list.
Auditing and assurance services : You have just been hired by a Large Regional CPA firm and you have been assigned to audit the Inventory account of $3,000,000 which represents 30% of the assets of the company. Audit standards require the auditor to consider the combined amount of mi..
How did western ideals spread from greece throughout asia : How did Western ideals spread from Greece throughout Asia and What was the "censor" in early Chinese governments
Reducing progression to hypertension reports : A clinical trial designed to show the efficacy of a new drug in reducing progression to hypertension reports the following:
Non-cancelable lease agreement : Assume that the following facts pertain to a non-cancelable lease agreement between Fifth-Third Leasing Company and Bob Evans Farms, a lessee.

Reviews

Write a Review

Python Programming Questions & Answers

  Reinforce topic material on simple functions

Select 3 sets of test data that will demonstrate the correct 'normal' operation of your program. Select another 2 sets of test data that will demonstrate the "abnormal" operation of your program.

  Question 1 research 5-8 species within one family of birds

question 1 research 5-8 species within one family of birds. be sure to use primary or very good secondary literature

  Write a loop that counts the number of space

Write a loop that counts the number of space characters in a string. Recall that the space character is represented a

  The program should allow the student

The program should allow the student to enter the answer. If the answer is correct, a message of congratulations should be displayed. If the answer is incorrect, a message showing the correct answer should be displayed.

  Write a program using the ''requetinteger''

using python/jython programming write a program using the 'requetInteger' function that will ask the user to type a value that will draw a line from one point on a picture to another. I don't need specific help just a gerneral idea.

  Assume that the variables gpa , deanslist and studentname

Assume that the variables gpa , deansList and studentName , have been initialized. Write a statement that adds 1 to deansList and prints studentName to standard out if gpa exceeds 3.5.

  Program to do the enciphering

Write a program to do the enciphering. It should prompt the user for a message, and print out both the entered message and its corresponding ciphertext.

  Implement your algorithm in python

Write an algorithm in structured English (pseudocode) that describes the steps required to perform the task specified and reinforce topic material related to the programming work cycle, and the input, processing, output program structure.

  Improve the structural design - haunted house game

List the things you changed and the purpose of changing it. Good reasons include making code easier to read and easier to navigate when modifying it.

  Specializes in solving the equations ax=b by doolittle''s dec

Write a  program that specializes in solving the equations Ax=b by Doolittle's decomposition method, where a is the HIbber matrix of arbitrary size nxn

  Write a python program

Write a Python program

  Explain a python program storing and processing simple bank

A Python program storing and processing simple bank records is in the early stages of development. The records are stored in a text file (bank.txt) that contains, for each bank customer, their given name, account number and balance.

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