Thread: datafile access

  1. #1
    Registered User brianptodd's Avatar
    Join Date
    Oct 2002

    datafile access

    What I'm trying to do is access a datafile that lists a first name and a salary. I need to use an "Employee" class that my teacher provided.

    I am having problems understanding how to incorporate the input of the stream to the constructor functions in the Employee class. I need to keep track of how many employees are read in the file, what the minimum and maximum salary is and also the average salary. All these things need to be output to the screen.

    I have included a zip file with the Employee class, my program (emps.cpp), and the datafile (emps.dat) that I am using. However, the program needs to be capable of reading an infinite (relatively) amount of employees out of the file.

    I need help in bringing the lines of data into the program and sending that data to the appropriate constructor function in the Employee class.

    All help is appreciated. This is making me insane.


  2. #2
    Registered User GreenCherry's Avatar
    Join Date
    Mar 2002
    Why dont you post this code on the board so I can look through it? I would ather not d/l it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Order of access labels in class definition
    By Mario F. in forum C++ Programming
    Replies: 10
    Last Post: 06-16-2006, 07:13 AM
  2. ww hosting and SSH access
    By spoon_ in forum A Brief History of
    Replies: 9
    Last Post: 04-07-2005, 08:49 AM
  3. Replies: 3
    Last Post: 09-22-2003, 09:48 PM
  4. Easy Problem?: How to open/read a datafile
    By zipfur in forum C Programming
    Replies: 3
    Last Post: 11-17-2002, 04:44 PM