473,406 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

files

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.

Feb 21 '07 #1
13 1579
Le 21-02-2007, jo********@yahoo.com <jo********@yahoo.coma écrit*:
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
Feb 21 '07 #2
<jo********@yahoo.comwrote:
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.
Feb 21 '07 #3
jo********@yahoo.com wrote:
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.

Feb 21 '07 #4
On Feb 21, 5:10 am, joel_ma...@yahoo.com wrote:
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.

Feb 21 '07 #5
jo********@yahoo.com wrote:
>
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
Feb 21 '07 #6
On Feb 21, 7:22 am, CBFalconer <cbfalco...@yahoo.comwrote:
b) Being paid in advance at 200 USD per hour, minimum 4 hours, by
certified cheque.
These can be forged--don't trust them.

-Beej

Feb 21 '07 #7
Beej wrote, On 21/02/07 17:27:
On Feb 21, 7:22 am, CBFalconer <cbfalco...@yahoo.comwrote:
> b) Being paid in advance at 200 USD per hour, minimum 4 hours, by
certified cheque.

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.
--
Flash Gordon
Feb 21 '07 #8
On Feb 21, 10:55 am, Flash Gordon <s...@flash-gordon.me.ukwrote:
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

Feb 21 '07 #9
In article <11**********************@a75g2000cwd.googlegroups .com>,
Beej <be**@beej.uswrote:
>On Feb 21, 10:55 am, Flash Gordon <s...@flash-gordon.me.ukwrote:
>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. :)
There are high-quality forged certified cheques going around as well.

http://www.dcu.org/streetwise/march2005.html
--
All is vanity. -- Ecclesiastes
Feb 21 '07 #10

<jo********@yahoo.comwrote in message
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.

Feb 21 '07 #11
Malcolm McLean <re*******@btinternet.comwrote:
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.

--
C. Benson Manica | I *should* know what I'm talking about - if I
cbmanica(at)gmail.com | don't, I need to know. Flames welcome.
Feb 21 '07 #12
On Feb 21, 5:10 am, joel_ma...@yahoo.com wrote:
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.

Feb 22 '07 #13

"Christopher Benson-Manica" <at***@ukato.freeshell.orgwrote in message
Malcolm McLean <re*******@btinternet.comwrote:
>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.
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.

Feb 22 '07 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip...
44
by: Xah Lee | last post by:
here's a large exercise that uses what we built before. suppose you have tens of thousands of files in various directories. Some of these files are identical, but you don't know which ones are...
0
by: Tom Lee | last post by:
Hi, I'm new to .NET 2003 compiler. When I tried to compile my program using DEBUG mode, I got the following errors in the C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7 \include\xdebug...
18
by: JKop | last post by:
Here's what I know so far: You have a C++ project. You have source files in it. When you go to compile it, first thing the preprocessor sticks the header files into each source file. So now...
3
by: pooja | last post by:
Suppose i have created a class c1 with f1()in c1.cpp and included this c1.cpp in file1.cpp file , which is also having main() by giving the statement #include "c1.cpp". the same i can do by...
11
by: ambika | last post by:
Iam just trying to know "c". And I have a small doubt about these header files. The header files just contain the declaration part...Where is the definition for these declarations written??And how...
22
by: Daniel Billingsley | last post by:
Ok, I wanted to ask this separate from nospam's ridiculous thread in hopes it could get some honest attention. VB6 had a some simple and fast mechanisms for retrieving values from basic text...
18
by: UJ | last post by:
Folks, We provide custom content for our customers. Currently we put the files on our server and people have a program we provide that will download the files. These files are usually SWF, HTML or...
0
by: wal | last post by:
How does one attach files to emails using libgmail? The following code http://pramode.net/articles/lfy/fuse/4.txt works fine when said files are simple text files, but it failes as soon as the...
3
by: aRTx | last post by:
I have try a couple of time but does not work for me My files everytime are sortet by NAME. I want to Sort my files by Date-desc. Can anyone help me to do it? The Script <? /* ORIGJINALI
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.