Answer to Question #71012 in C# for Vanessa Mthimkulu
Create a text file that contains the necessary data for a call record for at least five calls. When the application starts, it should read the data from the file and create a CallRecord object for each calls’ data. The CallRecord objects should be added to a List, and each call callID should be displayed in a list box on the application’s main form. When the user selects a callID from the list box, a second form should appear displaying that calls’ details individually using the relevant controls.
date = _date;
time = _time;
duration = _duration;
3. Create class CallRecord : Call and add private fileds : int callID, String mob_network, double cost;
4. Add constructor to CallRecord :
CallRecord(int _callID, String _mob_network, double _cost) : base(Datetime _date, Datetime _time, double _duration)
callID = _callID;
mob_network = _mob_network;
cost = _cost;
5. Create .txt file and fill 5 phone calls there, after call function ReadFromFile to put data in List, here how it will look in debugger after reading data from file:
CallRecord rec = new CallRecord(1, “LifeCell”, 2.5, “08.11.17”, “19:10”, 13);
6. After in form we add List to ListBox in loop: ListBox.Items.Add(List);
7. Create an event onSelection where we will show detailed information about call in textBox for example.
Need a fast expert's response?Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!