Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

It is a python programming question. It will have to use functions, file handling, exception handling and Lists. Also, don't use other Python Modules/Libraries except

It is a python programming question. It will have to use functions, file handling, exception handling and Lists. Also, don't use other Python Modules/Libraries except math and random (if required).

Thank you

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

TASK The Follow Me system keeps track of all travel card activities to ensure that customers are charged the correct rates. It allows the billing staff to view the activities for a specific card, station or time range. The system expects the travel card log data to be stored in a simple comma-separated text file with the format: card, time, tap, station, balance A sample log file data is shown below: 1168433, 07:00, on, Town Hall, 20.50 1299512, 07:45, on, Mascot, 52.14 1168433, 08:21, off, Penrith, 12.02 1299512, 08:30, ofs,Blacktown, 46.06 1564482, 11:23, on, Mascot, 5.20 1749743, 12:52, on, Parramatta, 11.35 You are required to develop a menu-based program that implements the Follow Me system. Your program should prompt the user for a travel card log data file name. After the file has been successfully read, the system will interact with the user to view the travel card activity according to the desired selections. Review the sample run below to clearly understand the requirements. Review the sample run below to clearly understand the requirements. Follow Me Viewer Enter the travel card log file name: cardact-210725.txt ** Reading travel card data ++ Success! Retrieved 6 records. Activity menu [A] 11 [C] ard [Sitation [T] rip > Select item or tQluit: A All Activity: ========= Card Time === Tap Station Balance 1168433 07:00 on Town Hall 1299512 07:45 on Mascot 1168433 08:21 off Penrith 1299512 08:30 Off Blacktown 1564482 11:23 on Mascot 1749743 12:52 on Parramatta ====== ======== $20.50 $ 52.14 $12.02 $46.06 $5.20 $11.35 === Activity menu [A] 11 [C] ard [Sitation [T] rip > Select item or Qiuit: c Cards 1168433 1299512 1564482 1749743 > Enter selection: 1168433 Card Activity (1168433]: Card Activity (1168433]: ==== Card Time Tap Station Balance 1168433 07:00 on Town Hall 1168433 08:21 off Penrith $20.50 $12.02 === Activity menu [A] 11 [C] ard [S] tation [T] ime > Select item or tQluit: S Stations: ========= Town Hall Mascot Penrith Blacktown Parramatta > Enter selection: mascot Station Activity (Mascot]: ========================= Card Time Tap Station === Balance 1299512 07:45 on 1564482 11:23 on Mascot Mascot $52.14 $5.20 Activity menu [A] 11 [C] ard [S] tation [T] ime > Select item or [0] uit: t > Enter start time (hour) : 8 > Enter end time (hour) : 12 Your program must validate the card activity data file before proceeding. Specifically, your program must verify the following: each line consists of exactly five fields separated by commas card must be an integer in the range 1000000 to 1899999 time must be in hh:mm format in the range 00:00 to 23:59 tap can have only two values: 'on' and 'off' If any of these conditions is not satisfied, the program should display an error message and quit. Below is a sample run when an incorrectly formatted file is provided. Follow Me Viewer Enter the travel card log file name: cardact-badformat.txt ** Reading travel card data ** Error! File is not correctly formatted. Have a nice day! Constraints 1. You must create functions for card, station and time activities. Each function should accept the selection parameter(s) and return a list of matching records. 2. You must handle the IOError or FileNotFoundError exception with a specific handler. In addition, your program must not crash regardless of the input provided. 3. Your program must not import any library or module other than your own written modules (if any). Task 1 (15 marks) Implement your program in Python. Comment on your code as necessary to explain it clearly. Task 2 (5 marks) Select at least three sets of test data that will demonstrate the normal operation of your program; that is, test data that will demonstrate what happens when a valid input is entered. Select at least two sets of test data that will demonstrate the abnormal operation of your program; that is, test data that will demonstrate what happens when an invalid input is entered or when an error is encountered. Set it out in a tabular form as follows: test data type, test data, the reason it was selected, the output expected due to using the test data, and finally a screenshot of the output actually observed when the test data is used. It is important that the output listings (i.e., screenshots) are not edited in any way. Data type Test data Reason it was selected Expected output Screenshot of actual output Normal Normal Normal Abnormal Abnormal Run your program using the test data you have selected and complete the last column of test data tables above

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Publishing With Filemaker Pro On The Web

Authors: Maria Langer

1st Edition

0201696657, 978-0201696653

More Books

Students also viewed these Databases questions