Professional Documents
Culture Documents
Workshop
Workshop
Android applications of a number of Customers from a file and holds these records in a
dynamically allocated array of Customers. (Each record holds the app's identifier
(Package_name), The user's identifier (user_id), spent time in hours (timeinhours) , day
of
the year (dayofyear), spent foreground Wi-Fi network connection time(ms)(Fwifitime),
and day of week (dayofweek), spent foreground cellular network connection time(ms)
(Fctime), in a .csv file format.) After loading all the information into a dynamic array of
Customers, the program will groups the records based on the user_id in ascending
order
Execution example
This program is partially developed, and you can find all the files in the file directory.
Your task is to complete the code as stated in the comments in the source code.
The Code
The structure holding the customers' records is designed as follows:
Records were retrieved successfully
Data records were grouped by the user id successfully
User id, timeinhours, Fctime, Fwifitime, Package Name
.....................................................
0,1.49325,369926,5005762,com.tencent.mm
0,1.35947,172756,4721320,com.tencent.mm
0,1.66986,1221,6010276,com.UCMobile
5,1.60287,5722288,48042,com.sina.weibo
5,1.92426,260011,6667309,com.tencent.mm
5,1.47877,2089902,3233672,com.UCMobile
9,1.02618,288007,3406229,com.digiplex.game
9,1.23554,59991,4387945,com.tencent.mm
9,12.9425,2190642,44402341,com.tencent.mm
9,1.21251,2544077,1820967,com.tencent.qqmusic
.....................................................
Data was successfully printed
Dynamically allocated memory was successfully deallocated
struct Customers {
char* Package_Name;
int user_id;
double timeinhours;
Data Entry
No data entry