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

  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 program that uses a bar

Write a program that uses a bar chart to display the percent-ages of the overall grade represented by the project, quizzes the midterm exam and the final exam

  Write python program isosceles tri equilateral tri rectangle

Write python program Isosceles Tri Equilateral Tri Rectangle, Write another "driver" script called project1.py which imports the polygon.py module, reads an input file of polygonal data and writes another file of areas and perimeters.

  Console program where you will implement

Create a console program where you will implement coding constructs and variables that are needed for this program and will implement the code within Main and any required static methods.

  Create mini-python projects or programs

Your assignment is to create mini-Python projects or programs and to run them in the Python-IDLE environment

  Write a program using the requetinteger function

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.

  Write a program that opens an encrypted file

Write a second program that opens an encrypted file and display its decrypted contents on the screen.

  Disabled individuals open jars and containers

What variables are you going to need and what will be their datatype and how would you break this problem into numerous smaller units?

  The dictionary order based on the ascii order

Needless to say, the dictionary order based on the ASCII order is not what a real-world indexing software wants. So, we want to implement the dictionary order of strings in the standard wa

  Create a cheat commands in the game so player can teleport

Create a cheat commands in the game so player can teleport to any location in the map - The first four tasks in this section can be completed by modifying only the code within the ProcessStatement() and Game() functions. This section typically requ..

  What are the issues assciated with top-down analysis

what are the issues assciated with top-down analysis please explain?

  Design a prgram using python

Design a prgram USING PYTHON that students can use to calculate what score they need on final exam to get a certan final grade for a course.

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