Write python program that allow the user to reads contents

Assignment Help Computer Engineering
Reference no: EM131228881

Task -

In the Resources section of the Interact2 subject website there is a data file called students.txt. This file contains student details: a valid student number, course (BIT) and the specialization (EX: Network engineering). Each student number is an eight digit number 1156319. (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 allow the user to 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 student number input matches an element somewhere in the list, the program should display the number together with the course and the specialization. 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 student 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 an 8 digits. (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 digits (as distinct from valid student 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.

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.

Rationale -

  • Reinforce topic material related to files and exceptions.
  • Reinforce topic material related to lists.

Student.txt

11555555 MIT Computer Networking

11565656 MIT Network Security

11575757 MIT Software Design and Development

11585858 MIT Systems Analysis

11555657 MIT Business Analysis

11555556 MI Computer Networking

11595956 BIT Network Engineering

11595957 BIT Software Design and Development

11595958 BIT Systems Administrauon

11595959 BIT Business Analysis

115959 BIT Network Engineering

rates.txt

0 5000 2

5001 10000 3

10001 15000 4

15000 100000 5

Attachment:- Sample.rar

Reference no: EM131228881

Questions Cloud

Legal and ethical considerations associated with project : Your presentation from the previous week was well accepted by the project staff and senior management. The Executive Vice President of Operations asked a question about the legal and ethical issues that are relevant to the contractor dispute. You ..
Discussing the current management-organizational behavior : A five-page (double-spaced) paper discussing the current management and organizational behavior issues within Delta Airlines using management and organizational behavior concepts
Explain the risk management process : Explain the risk management process as it pertains to the fire department. Please use examples to demonstrate your understanding of the risk management process. 200 words in length. APA style?
Determine the cross-sectional areas : ME 255: Strength of Materials - system of steel pipes is loaded and supported as shown below. If the normal stress in each pipe must not exceed 150 MPa, determine the cross-sectional areas
Write python program that allow the user to reads contents : Design an algorithm and use it to write a Python program that allow the user to 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
Results of a job evaluation you were the subject : In a short essay of two or three paragraph, share the results of a job evaluation you were the subject of.  Did the supervisor give you adequate notice and invite your opinions, including a self-evaluation?  Did you feel the experience was a valid..
Is a statement of the boundary conditions : Hint: Treat this problem as a dielectric slab with a perfect conductor backing, and use the analytical methods of Chapter 9.
Analyze the impact of global environmental policy associated : Analyze the impact of global environmental policy associated with these issues. Devise a 3-5 slide PowerPoint, providing a review of the paper above, present in class.
The natural variation of a process relative to the variation : Design specifications reflecting customer requirements for a product are known as. When the process capability ratio is less than 1.0. The natural variation of a process relative to the variation allowed by the design specifications is known as

Reviews

len1228881

10/3/2016 1:32:27 AM

Need it as per the guidelines, sample is also attached given by my university and please use the same python version, please make sure requirements should be completed.

Write a Review

Computer Engineering Questions & Answers

  Can you suggest process for choosing appropriate data-mining

Consider on how you would know if a computer were thinking like a human.

  Write a program takes two randomly generated parallel arrays

The random number generation for both arrays would be done in a method, both when the arrays are first populated and when they have to be repopulated.

  Write a program that takes its input from a binary file

The number a is the average of the numbers n1, n2, n3, and so forth. Hint: Write your program so that it first reads the entire file and computes the average of all the numbers, then closes the file, and then reopens the file and computes the stan..

  Questionto take advantage of a string means to change the

questionto take advantage of a string means to change the first letter of each word in the string to uppercase. for

  Latter discloses the password length

Not having the computer echo the password is safer than having it echo an asterisk for each character typed, since the latter discloses the password length to anyone nearby who can see the screen.

  Flow of email messages from jamborea to your customers

A few of the messages, however, are probably legitimate emails.  Should you do anything to restrict the flow of email messages from Jamborea to your customers?

  Implementing an intrusion detection system

Your company is trying to decide whether to implement an intrusion detection system (IDS), or an intrusion prevention system (IPS).

  Write a valid assignment statement

Thus, both processes are blocked forever, the producer waiting for the mutex to be unlocked and the consumer waiting for a signal from the producer. Is this a resource deadlock or a communication deadlock? Suggest methods for its control.

  Develop a pac chart, interactivity chart

Develop a solution that will calculate the price of an item for each of the five days, given the original price. Test the solution for an item costing $10.00. Develop a PAC Chart, Interactivity Chart,IPO chart, Algorithm, and Flowchart

  Explain the itil framework minimize the impact of change

The ITIL framework evolved from the UK Government's efforts during the 1980s to document how successful organizations approached service management. In what ways can the ITIL® framework minimize the impact of change

  Find instruction format for each instruction - mips program

Using the MIPS program below (including bugs), find the instruction format for each instruction and the hexadecimal values of each instruction field.

  Query using an update statement

Here is issue, a table namedPoints varchar(81) has values stored in a column named Point. There are two columns in the Points table, X and Y.

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