question question question 
Author Message
 question question question

Hi,

I am just starting to program in C and C++.  I have a ascii file that looks like the
following:

Mon mar 28 12:12:10 1997
runner 1: Joe Smith
warm-up time: 00:05:58
Health: Excellent
running time: 00:10:29
check out time: 00:08:40

Fri apr 20 10:09:00 1997
runner 2: Adam Smith
warm-up time: 00:07:45
Health:good
running time: 00:07:23
check out time: 00:04:45

..
..
..

Ok now i need to write a C or C++ program to calculate for the total running time
when the health was "excellent" or "good",.... It means not just the total but i have
break it in different categories. It is going to be compiled on PC.

Now how can write this program. Where should i start from?. Do i have to
structres?.How do i say to go and read the next line. What should I do with the ":"
characters.


I greatly appreciate your help in advance.

Terry A.



Sat, 30 Oct 1999 03:00:00 GMT  
 question question question

Quote:

> Hi,

> I am just starting to program in C and C++.  I have a ascii file that looks like the
> following:

> Mon mar 28 12:12:10 1997
> runner 1: Joe Smith
> warm-up time: 00:05:58
> Health: Excellent
> running time: 00:10:29
> check out time: 00:08:40

> Fri apr 20 10:09:00 1997
> runner 2: Adam Smith
> warm-up time: 00:07:45
> Health:good
> running time: 00:07:23
> check out time: 00:04:45

> ..
> ..
> ..

> Ok now i need to write a C or C++ program to calculate for the total running time
> when the health was "excellent" or "good",.... It means not just the total but i have
> break it in different categories. It is going to be compiled on PC.

> Now how can write this program. Where should i start from?. Do i have to
> structres?.How do i say to go and read the next line. What should I do with the ":"
> characters.


When the teacher give you an siignment I'd assume that he taught you
enough to at least give it an honest try. If your solution doesn't
work ask here for specific help.

Stephan
(self appointed member of the campaign against grumpiness in c.l.c)



Sun, 31 Oct 1999 03:00:00 GMT  
 question question question

Quote:

> When the teacher give you an siignment I'd assume that he taught you
> enough to at least give it an honest try. If your solution doesn't
> work ask here for specific help.

> Stephan
> (self appointed member of the campaign against grumpiness in c.l.c)

I am not a student nor a teacher. I am just a trainer who happens to be
doing some
programming for himself to save time.

Thanks for your honesty.

Terry



Sun, 31 Oct 1999 03:00:00 GMT  
 question question question

Read the input parsing as you go and do a switch case for matching
conditions..

Remove the  '-'   from orion-data for sending email to me.


Orion Data Systems

Solicitations to me must be pre-approved in writing
by me after soliciitor pays $1,000 US per incident.
Solicitations sent to me are proof you accept this
notice and will send a certified check forthwith.


Quote:
> Hi,

> I am just starting to program in C and C++.  I have a ascii file that
looks like the
> following:

> Mon mar 28 12:12:10 1997
> runner 1: Joe Smith
> warm-up time: 00:05:58
> Health: Excellent
> running time: 00:10:29
> check out time: 00:08:40

> Fri apr 20 10:09:00 1997
> runner 2: Adam Smith
> warm-up time: 00:07:45
> Health:good
> running time: 00:07:23
> check out time: 00:04:45

> ..
> ..
> ..

> Ok now i need to write a C or C++ program to calculate for the total
running time
> when the health was "excellent" or "good",.... It means not just the
total but i have
> break it in different categories. It is going to be compiled on PC.

> Now how can write this program. Where should i start from?. Do i have to
> structres?.How do i say to go and read the next line. What should I do
with the ":"
> characters.


> I greatly appreciate your help in advance.

> Terry A.



Sun, 31 Oct 1999 03:00:00 GMT  
 question question question

Quote:


> > When the teacher give you an siignment I'd assume that he taught you
> > enough to at least give it an honest try. If your solution doesn't
> > work ask here for specific help.

> > Stephan
> > (self appointed member of the campaign against grumpiness in c.l.c)

> I am not a student nor a teacher. I am just a trainer who happens to be
> doing some
> programming for himself to save time.

> Thanks for your honesty.

> Terry

If that's the case, I wouldn't use the file format you have chosen.  I
would write your program to save the data in a fixed length database
format so it would be easier to read and calculate results.  The text
file format you have chosen is slow and hard to work with.  I'ts good
for a teaching tool, but bad for what you are trying to do.
--
Mike Settles



Sun, 31 Oct 1999 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. This is a biztalk question but probably an easy question for you C# guru's

2. Non-Programming Question... experience question mostly

3. Not C program question, historical question

4. A question regarding FAQs question 12.2

5. Question FAQ question

6. Peer to peer board game - possible remoting question or design question

7. if(question) || if question

8. array question - beginner question

9. questions, questions, and than some

10. Solaris Unix Porting Question / Signals Question

11. A similar lint question (and questions about casts)

12. Newbie: CATALOG sample question (SIMPLE question)

 

 
Powered by phpBB® Forum Software