68 464
Assignments Done
98,6%
Successfully Done
In December 2018

Answer to Question #71012 in C# for Vanessa Mthimkulu

Question #71012
Create a class Call, which contains information about a call made via mobile phone. This class should have the necessary members for the about date, time of start and duration of the call. Your application should have another class named CallRecord that inherits from the Call class. The CallRecord class should have necessary members, i.e. the callID, the receivers’ mobile network and the cost of the call.
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.
Expert's answer
Call(Datetime _date, Datetime _time, double _duration)
{
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);
List.add(rec);
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!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions