Solved

procedure to find wage

Posted on 2000-03-20
4
272 Views
Last Modified: 2010-04-16
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
Comment
Question by:kazooie21
  • 2
  • 2
4 Comments
 

Author Comment

by:kazooie21
ID: 2638376
Adjusted points from 30 to 40
0
 
LVL 47

Accepted Solution

by:
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

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

Expert Comment

by:dbrunton
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

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now