datafile access

This is a discussion on datafile access within the C++ Programming forums, part of the General Programming Boards category; What I'm trying to do is access a datafile that lists a first name and a salary. I need to ...

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

    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.

    Brian
    Attached Files Attached Files

  2. #2
    Registered User GreenCherry's Avatar
    Join Date
    Mar 2002
    Posts
    65
    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, 08:13 AM
  2. ww hosting and SSH access
    By spoon_ in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 04-07-2005, 09:49 AM
  3. Replies: 3
    Last Post: 09-22-2003, 10: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21