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

  We would like to implement the lexical order

We would like to implement the lexical order for lists. For simplicity, we only consider lists of numbers, where , >= have their usual meaning.

  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.

  Find a python script

Find a python script

  Part-1for task 1 list the things you changed and the

part-1for task 1 list the things you changed and the purpose of changing it. good reasons include making code easier

  Python program that reads in a series of positive integers

Write a Python program that reads in a series of positive integers and writes out theproduct of all the integers less than 25 and the sum of all the integers greater than or equal to 25. Use 0 as a sentinel value

  Permutation ciphers

Permutation Ciphers (a.k.a. Transposition Ciphers) are another class of simple cryptosystems. For this we use the functions apply(.,.) and inv(.) from Homework 4; copy these two functions into your le as auxiliary functions.

  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

  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.

  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.

  Q1if we knew all the ecological social and competitive

q1if we knew all the ecological social and competitive forces that regulate populations and in reality we couldnt what

  Programmer does not have to use the def statement

Unlike Z+-, the programmer does not have to use the DEF statement to create a variable. Instead, the programmer can simply use the variable. The first use of the variable creates it and initializes it to 0.

  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.

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