files


M

Marc Boyer

Le 21-02-2007 said:
how do i go about this?pliz help if you can
a company keeps a payroll file containing the following details for
each of its employees:name,employees
number,grade(manual,clerical,supervisor or managerial),gross pay,tax
deductions and number of years and months of service.This is used for
printing payslips,supplying tax details to the authorities,
calculating pension deduction and other employees payroll data.
am required to write a program to update the payroll file to include
details of new employees ordered by employee number.Assume that
employee number are unique.

Yes, and you also should give us the email address of your teacher,
the, we could email him directly the solution.

Marc Boyer
 
Ad

Advertisements

J

joel_maina

how do i go about this?pliz help if you can
a company keeps a payroll file containing the following details for
each of its employees:name,employees
number,grade(manual,clerical,supervisor or managerial),gross pay,tax
deductions and number of years and months of service.This is used for
printing payslips,supplying tax details to the authorities,
calculating pension deduction and other employees payroll data.
am required to write a program to update the payroll file to include
details of new employees ordered by employee number.Assume that
employee number are unique.
 
O

osmium

how do i go about this?pliz help if you can
a company keeps a payroll file containing the following details for
each of its employees:name,employees
number,grade(manual,clerical,supervisor or managerial),gross pay,tax
deductions and number of years and months of service.This is used for
printing payslips,supplying tax details to the authorities,
calculating pension deduction and other employees payroll data.
am required to write a program to update the payroll file to include
details of new employees ordered by employee number.Assume that
employee number are unique.

I have a hard time imagining an organization in which the employee numbers
are NOT unique, that's what an employee number is. So ignore that tidbit.

First come up with a structure for one particular employee. Then come up
with a way to represent the aggregate of all employees. Apparently the file
exists and is operated on, solely from the external medium, which sounds
archaic in this day and age, but so be it. I wish the exercise said more in
the way of requirements. I guess you might as well add new employees at the
end of the file, regardless of what that does to order. The order is
chaotic, but that's what you get with sketchy specifications. Your program
only has to read the entire file and add the new employee at the end of the
file.
 
S

santosh

how do i go about this?pliz help if you can
a company keeps a payroll file containing the following details for
each of its employees:name,employees
number,grade(manual,clerical,supervisor or managerial),gross pay,tax
deductions and number of years and months of service.This is used for
printing payslips,supplying tax details to the authorities,
calculating pension deduction and other employees payroll data.
am required to write a program to update the payroll file to include
details of new employees ordered by employee number.Assume that
employee number are unique.

The method would differ depending on the exact format of the payroll
file and whether it's in text or binary format. If all your new
records need only be appended at the end of the file, you can just
open the file with "a" or "ab" mode. Otherwise you need to use the
file positioning functions like fseek and rewind to go to the proper
position before writing data. If you need to insert data without
overwriting existing data, you need to basically rewrite the file.
 
C

CBFalconer

how do i go about this?pliz help if you can

pliz doesn't post here anymore.
a company keeps a payroll file containing the following details for
each of its employees:name,employees
number,grade(manual,clerical,supervisor or managerial),gross pay,tax
deductions and number of years and months of service.This is used for
printing payslips,supplying tax details to the authorities,
calculating pension deduction and other employees payroll data.
am required to write a program to update the payroll file to include
details of new employees ordered by employee number.Assume that
employee number are unique.

Even if he did, he wouldn't do your homework for you without
either:

a) having the email address of your instructor (to send the
answer).

b) Being paid in advance at 200 USD per hour, minimum 4 hours, by
certified cheque.

In addition he would want a properly punctuated, capitalized, etc.
specification of the job, rather that the illiterate paragraph
above, which a normal 4th grader would be ashamed to write.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>

"A man who is right every time is not likely to do very much."
-- Francis Crick, co-discover of DNA
"There is nothing more amazing than stupidity in action."
-- Thomas Matthews
 
V

vicky

how do i go about this?pliz help if you can
a company keeps a payroll file containing the following details for
each of its employees:name,employees
number,grade(manual,clerical,supervisor or managerial),gross pay,tax
deductions and number of years and months of service.This is used for
printing payslips,supplying tax details to the authorities,
calculating pension deduction and other employees payroll data.
am required to write a program to update the payroll file to include
details of new employees ordered by employee number.Assume that
employee number are unique.

hi Joel,

as you are trying to make a data base project you have to take a
unique field in your field list like empcode and beside it also take a
secondary field as employ grade to distinguish the several categories
of employ then general fields.

at last while printing don't print all fields just prints few imp
fields.
 
Ad

Advertisements

F

Flash Gordon

Beej wrote, On 21/02/07 17:27:
These can be forged--don't trust them.


Chuck forgot to mention that the work is not started until after the
check has been safely cleared.
 
B

Beej

Chuck forgot to mention that the work is not started until after the
check has been safely cleared.

I was tired when I wrote that anyway, and thought he said "cashier's
check". Certified check is much better. :)

-Beej
 
M

Malcolm McLean

how do i go about this?pliz help if you can
a company keeps a payroll file containing the following details for
each of its employees:name,employees
number,grade(manual,clerical,supervisor or managerial),gross pay,tax
deductions and number of years and months of service.This is used for
printing payslips,supplying tax details to the authorities,
calculating pension deduction and other employees payroll data.
am required to write a program to update the payroll file to include
details of new employees ordered by employee number.Assume that
employee number are unique.
Why do instructors give such boring assignments?
They are not even realistic. Any company with any sense would use a proper
database to store employee information.

However you need the file format. Then you simply open the file in append
mode, input data from the user, and output records in that format. The
format will be something like surname, firstname, grade. However fields
could be fixed width or they could be delimited by quotes or commas. The
grade could be a code or the full-length word.
 
Ad

Advertisements

C

Christopher Benson-Manica

Malcolm McLean said:
Why do instructors give such boring assignments?

Firstly, it's worth noting that many instructional tools are
necessarily didactic and boring - few, if any, piano students enjoy
their Czerny and Hanon drills any more than aspiring programmers enjoy
solving contrived, unrealistic problems. It's the same with learning
your multiplication tables or laboring over pages of integrals to
solve; practice makes perfect.
They are not even realistic.

Depending on the target students, that may or may not be a problem.
No one should get a computer science degree without successfully
enduring the tedium of these introductory exercises before moving on
to more complex, more realistic problems. On the other hand, those
"computer science for non-majors" classes that dish out these same
abstract problems are really a waste of everyone's time.
Any company with any sense would use a proper
database to store employee information.

And anyone would use a calculator to calculate n!, but there is no
reason not to continue assigning "calculate n! recursively" problems,
is there? The real question is where OP's homework question occurred
in his curriculum.
 
U

user923005

how do i go about this?pliz help if you can
a company keeps a payroll file containing the following details for
each of its employees:name,employees
number,grade(manual,clerical,supervisor or managerial),gross pay,tax
deductions and number of years and months of service.This is used for
printing payslips,supplying tax details to the authorities,
calculating pension deduction and other employees payroll data.
am required to write a program to update the payroll file to include
details of new employees ordered by employee number.Assume that
employee number are unique.

An employer is keeping employee data in a flatfile instead of a
database?
That business is going under, pronto.

Write out the definition for a structure.
(Ref:C-FAQ, Section 2. Structures, Unions, and Enumerations)

Define the domain for each object in the struct. That will give you a
clue as to what data type to choose.
For instance, should it be an integer, a float, a character array, an
enum ...?

Define two functions that reads/writes the struct, piece by piece.
It's not portable to write the whole thing at once.

If you don't care how slow it is, that's all you need. Of course it
will take eons to find things, update things, etc.
 
Ad

Advertisements

M

Malcolm McLean

Christopher Benson-Manica said:
Firstly, it's worth noting that many instructional tools are
necessarily didactic and boring - few, if any, piano students enjoy
their Czerny and Hanon drills any more than aspiring programmers enjoy
solving contrived, unrealistic problems. It's the same with learning
your multiplication tables or laboring over pages of integrals to
solve; practice makes perfect.
Your first program should be "Hello World". It's traditional.

Program 2 can be "space invaders". Give pupils a "printat" and a "kbhit",
and they're away. Some will produce good games, the majority something just
about playable, but all will learn the basics of looping and logic control.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top