I need to write a program for class. I'm not necessarily looking for code, just help. I need to file input data in this format:
01 - 00:53 - 70
01 - 02:45 - 50
01 - 03:31 - 79
01 - 04:30 - 56
01 - 05:55 - 59
01 - 07:23 - 87
it is day/time/count. I need to take this data and calculate a max and average. The data file has maybe almost a thousand entries over the span of twenty days. Each day has a different amount of counts. I wanted to use a 3d array(array [time][count][day], but there would be empty elements messing with my math. What is the best way to go about this? Or am I wrong and the math would be fine?
enkidu75
0
Newbie Poster
Recommended Answers
Jump to Postt:
Why not convert the file into a ordered vector/list of time:count, using a structure
to represent the time. e.g.struct Item { int day; int timeSec; // Number of seconds from midnight int count; };
Then you can use a std::vector of Item, which you can …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.