Solved

# procedure to find wage

Posted on 2000-03-20
272 Views
company wage formula: \$100 +\$(employee's age) +\$(1 + 2 + 3....+years)

A 37 year old employee with six years would earn \$158 (that is, 100 + 37 + 21).  (the value 21 comes from 1 + 2 + 3 + 4 + 5 + 6)

I need a program that will receive as input one employee's name, age, and years and print the wage information. I've used the FINDPAY procedure. this procedure will need to calculate and print employee's name and wage information.

Here's what I got:

var name: string;
age: integer;
years: integer;
i: integer;

procedure FINDPAY (name: string;
age: integer;
years: integer;
i: integer);

var wage: integer;
begin
for i:= 1 to years
do
wage := \$100 + age + i;
writeln (name, ' \$', wage:5:1);
end; {FINDPAY}

begin {main}
name := 'Jack' ;
age := 54;
years := 32;
FINDPAY (name, age, years)
end.
0
Question by:kazooie21
• 2
• 2

Author Comment

ID: 2638376
Adjusted points from 30 to 40
0

LVL 47

Accepted Solution

dbrunton earned 40 total points
ID: 2639037
procedure FINDPAY (name: string; age: integer; years: integer);

var
wage : integer;
temp : integer;
begin
wage := 0;
for temp = 1 to years do
wage := wage + temp;
wage := 100 + age + wage;
writeln (name, ' \$', wage:5:1);
end; {FINDPAY}

Try the above procedure.  It's not tested but should work.
0

Author Comment

ID: 2642437
The procedure worked, but I now need it receive all employees.
0

LVL 47

Expert Comment

ID: 2643399
Post another question explaining what you want.  It's not quite clear enough.  Are you getting info from keyboard or file.  Whatever you will probably need to use records and an array of records to hold what you want.
0

## Join & Write a Comment Already a member? Login.

### Suggested Solutions

HOW TO: Upload an ISO image to a VMware datastore for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere Host Client, and checking its MD5 checksum signature is correct.  It's a good idea to compare checksums, because many installat…
In this article, I will show you HOW TO: Create your first Windows Virtual Machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, the Windows OS we will install is Windows Server 2016.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

#### 708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

#### Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!