Solved

procedure to find wage

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
USB Flash Drive Serial Numbers 9 3,975
Delphi Skype API 2 1,803
Problem inserting a record into SQL Server database from Delphi 10 1,019
Regular Expression to Split a String 7 110
If you thought ransomware was bad, think again! Doxware has the potential to be even more damaging.
February 24, 2017 — On February 23, Travis Ormandy, a vulnerability researcher at Google, reported on Twitter (https://twitter.com/taviso/status/834900838837411840) that massive stores of data have been leaked by CloudFlare, a company that provide…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

809 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