Solved

procedure to find wage

Posted on 2000-03-20
4
276 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 48

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 48

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Text To Speech and Speech To Text Enabled Delphi Application; 6 2,732
Delphi Ascii code 2 1,010
Delphi need modify hand cursor windows 4 565
interacting with web form 4 149
This article describes how to reset your Windows 10 password when you've forgotten it.
The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

840 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