Question: Complete the following tasks related to file using Python programming. ( a ) Create a file phoneLog . txt with at least 5 0 0

Complete the following tasks related to file using Python programming.
(a) Create a file phoneLog.txt with at least 500 records. This file should contain the following
fields:
day number, this represents the day number of the month and must be an integer value.
phone number, this should contain 10 digits and must be stored in a character array.
call duration (in minutes), this should be an integer value.
Status, this represents the incoming or outgoing call, use 0 for incoming and 1 for outgoing.
Note: User input is not required, the data should be randomly generated.
(b) Display a menu with the following options:
1. Display all records (this should display entire file in a tabular form with headings in first row)
2. Total number of minutes (this option should display the total minutes used in this month)
3. Distribution of minutes (this should display the total number of minutes for incoming and outgoing calls)
4. Total number of minutes used on a particular day (this option should ask the user to enter the day number and display the total number of minutes used on that day. For
example, if user enters day =10, this option should sum all minutes used on day =10.)
5. Phone number starts with area code (this option should ask the user to enter the area code such as 905,416,289 and displays complete record of all phone number matching
given area code.)
Test your program by first creating a file in (a) and then selecting menu options 1 through
5. Note: Assuming number of records is unknown. All above options must be completed
using functions. Use a class to model your data with the appropriate instance variables and methods.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!