Wages Programming Problem

Can anyone help with this problem, I have tried several websites but no one seems to be able to help. I need to create a Pascal Programme(not turbo) and test data for the following programme:-

A manufacturing company requires a program to produce, each week, the wages paid to employees within the workshop. Currently the employees work on a two shift system; the early shift (known as the 'A' shift) and the late shift (know as the 'B' shift). Currently workers are paid in the following way:

The 'A' shift:
10 for each shift attended
4 for each additional hour.

The 'B' shift:
12 for each shift attended
5 for each additional hour worked.

However, these pay rates are subject to change from week to week.

Someone please help me !!!!!!

Comments

  • : Can anyone help with this problem, I have tried several websites but no one seems to be able to help. I need to create a Pascal Programme(not turbo) and test data for the following programme:-
    :
    : A manufacturing company requires a program to produce, each week, the wages paid to employees within the workshop. Currently the employees work on a two shift system; the early shift (known as the 'A' shift) and the late shift (know as the 'B' shift). Currently workers are paid in the following way:
    :
    : The 'A' shift:
    : 10 for each shift attended
    : 4 for each additional hour.
    :
    : The 'B' shift:
    : 12 for each shift attended
    : 5 for each additional hour worked.
    :
    : However, these pay rates are subject to change from week to week.
    :
    : Someone please help me !!!!!!
    :

    So all you need is very straight forward program that asks
    'what is rate A', 'what is rate B', 'how many hours' etc.

    At the end just multiplay the values and that's it.

    [code]

    var ShiftA, ShiftB, OTimeA, OTimeB, Days, Hours, Wage:integer;
    Worker : string;
    Shift : char;

    begin
    writeln('Wage calculator');
    writeln('--------------------------');

    { Ask for new rates }
    write('What is regular rate for shift A: $');readln(ShiftA);
    write('What is overtime rate for shift A: $');readln(OTimeA);
    write('What is regular rate for shift B: $');readln(ShiftB);
    write('What is overtime rate for shift B: $');readln(OTimeB);
    writeln;

    { Ask for workers name }
    write('Enter workers name: ');
    repeat
    readln(Worker);
    until Worker<>'';
    Worker[1]:=UpCase(Worker[1]);
    writeln;

    { What shift did he work }
    write('What shift (A/B): ');
    repeat
    readln(Shift);
    until Shift in ['A','a','B','b'];
    Shift:=UpCase(Shift);
    writeln;

    { How many days and hours of overtime }
    write('How many days did ',worker,' work? ');readln(Days);
    write('How many hours are overtime? ');readln(Hours);

    { Calculate wage }
    If Shift='A' then Wage:=
    Days * ShiftA + Hours * OTimeA;

    If Shift='B' then Wage:=
    Days * ShiftB + Hours * OTimeB;

    { Display Result }
    writeln;
    writeln('Worker ',worker,' worked ',Shift,' shift.');
    writeln('Total wage for ',days,' days and ',hours,' hours of overtime');
    write('is $',wage,'. ');
    if shift='A'
    then writeln('($',ShiftA,' * ',Days,'Days + $',OTimeA,' * ',Hours,'Hours =$',wage,' )')
    else writeln('($',ShiftB,' * ',Days,'Days + $',OTimeB,' * ',Hours,'Hours =$',wage,' )');

    writeln;

    writeln('Press Enter to exit');readln;

    end.
    [/code]


    Iby


    [code]
    2B ?
    ------| |-----+----------( )----
    |
    2B |
    ------|/|-----+
    [/code]



  • : : Can anyone help with this problem, I have tried several websites but no one seems to be able to help. I need to create a Pascal Programme(not turbo) and test data for the following programme:-
    : :
    : : A manufacturing company requires a program to produce, each week, the wages paid to employees within the workshop. Currently the employees work on a two shift system; the early shift (known as the 'A' shift) and the late shift (know as the 'B' shift). Currently workers are paid in the following way:
    : :
    : : The 'A' shift:
    : : 10 for each shift attended
    : : 4 for each additional hour.
    : :
    : : The 'B' shift:
    : : 12 for each shift attended
    : : 5 for each additional hour worked.
    : :
    : : However, these pay rates are subject to change from week to week.
    : :
    : : Someone please help me !!!!!!
    : :
    :
    : So all you need is very straight forward program that asks
    : 'what is rate A', 'what is rate B', 'how many hours' etc.
    :
    : At the end just multiplay the values and that's it.
    :
    : [code]
    :
    : var ShiftA, ShiftB, OTimeA, OTimeB, Days, Hours, Wage:integer;
    : Worker : string;
    : Shift : char;
    :
    : begin
    : writeln('Wage calculator');
    : writeln('--------------------------');
    :
    : { Ask for new rates }
    : write('What is regular rate for shift A: $');readln(ShiftA);
    : write('What is overtime rate for shift A: $');readln(OTimeA);
    : write('What is regular rate for shift B: $');readln(ShiftB);
    : write('What is overtime rate for shift B: $');readln(OTimeB);
    : writeln;
    :
    : { Ask for workers name }
    : write('Enter workers name: ');
    : repeat
    : readln(Worker);
    : until Worker<>'';
    : Worker[1]:=UpCase(Worker[1]);
    : writeln;
    :
    : { What shift did he work }
    : write('What shift (A/B): ');
    : repeat
    : readln(Shift);
    : until Shift in ['A','a','B','b'];
    : Shift:=UpCase(Shift);
    : writeln;
    :
    : { How many days and hours of overtime }
    : write('How many days did ',worker,' work? ');readln(Days);
    : write('How many hours are overtime? ');readln(Hours);
    :
    : { Calculate wage }
    : If Shift='A' then Wage:=
    : Days * ShiftA + Hours * OTimeA;
    :
    : If Shift='B' then Wage:=
    : Days * ShiftB + Hours * OTimeB;
    :
    : { Display Result }
    : writeln;
    : writeln('Worker ',worker,' worked ',Shift,' shift.');
    : writeln('Total wage for ',days,' days and ',hours,' hours of overtime');
    : write('is $',wage,'. ');
    : if shift='A'
    : then writeln('($',ShiftA,' * ',Days,'Days + $',OTimeA,' * ',Hours,'Hours =$',wage,' )')
    : else writeln('($',ShiftB,' * ',Days,'Days + $',OTimeB,' * ',Hours,'Hours =$',wage,' )');
    :
    : writeln;
    :
    : writeln('Press Enter to exit');readln;
    :
    : end.
    : [/code]
    :
    :
    : Iby
    :
    :
    : [code]
    : 2B ?
    : ------| |-----+----------( )----
    : |
    : 2B |
    : ------|/|-----+
    : [/code]
    :
    :
    :
    : Some very kind person replied to my problem as above. When I sent this back to my tutor to be marked, he sent back my assignemnt saying that this is wrong ??????

  • : : Some very kind person replied to my problem as above. When I sent this back to my tutor to be marked, he sent back my assignemnt saying that this is wrong ??????

    It doesnt look like you posted the full question, so its likely that the answer provided to you had some assumptions made which may not match the specifications outlined by your tutor.

    Or, maybe it uses concepts he knows you do not understand, so he knows you cheated?
  • : : : Some very kind person replied to my problem as above. When I sent this back to my tutor to be marked, he sent back my assignemnt saying that this is wrong ??????
    :
    : It doesnt look like you posted the full question, so its likely that the answer provided to you had some assumptions made which may not match the specifications outlined by your tutor.
    :
    : Or, maybe it uses concepts he knows you do not understand, so he knows you cheated?

    The reason I came to such Programmers Heaven is beacuse of it good reputation and the fact that the people here a Programming Professionals. The other reason is beacuse when my assingment comes back from being marked I get help notes which are no help what so ever, so here is the question in full as it has been given to me:-

    A manufacturing company requires a progra, to produce, each week, the wages paid to employees within the workshop. Currently the eomployees work on a two shift system; the early shift (know as the 'A' shift) and the last shift (know as the 'B' shift). Currently, workers are paid in the following way:

    The 'A' shift:
    10 for each shift attended
    4 for each additional shift

    The 'B' shift:
    12 for each shify attended
    5 for additional hour worked

    However, these pay rates are subject to change from week to week.

    The rquired output should be in the form of a report, output tp a printer. The format of the report is left to you, but it should be in a tabular form and containthe following items:

    A heading containing the company name, title of the report and the current date and week number.

    A main body consisiting of detail lines of information for each of the workers. Each detail line should consist of the following:-

    Clock Card Number
    Worker's Name
    Number of shifts attended in a week
    Total hours worked in the week
    Shift attendance pay for the week
    Additional hours pay for the week

    A footer with the following end of report totals:

    Total number of employees
    Total attendance pay for all workers
    Total additional hours pay for all workers

    You can assume that the report will only require a single page.

    Test data is also required.
    :

  • [b][red]This message was edited by Moderator at 2002-10-30 8:17:26[/red][/b][hr]
    : The reason I came to such Programmers Heaven is beacuse of it good reputation and the fact that the people here a Programming Professionals. The other reason is beacuse when my assingment comes back from being marked I get help notes which are no help what so ever, so here is the question in full as it has been given to me:-

    ..snip..

    Well unless you changed iby's program before handing it in I can see why your teacher told you it was wrong. He was asking for a certain style of report (tabular) with certain information. He also said it should be sent to the printer.

    I dont know your teacher, but if mine said "test data is also required" I would know for a fact that he means a test datafile is required. A report program like this can almost be guaranteed to be reading an input file since it would be much to tedious for someone to sit there and manually enter information each week. So that may be another reason he considered it wrong.
  • here is a program we had to write last year, based on a wage program.. Not quite what you were looking for, but I hope it helps anyway.

    [code]
    {***************************MICHAEL CHARLES ROPER****************************}
    {********************************PERIOD 1-2**********************************}
    {****************************COMPUTER SCIENCE 1******************************}
    {**********************************11-5**************************************}

    PROGRAM C3WAGE02;
    {PROGRAM FINDS WAGES FOR SOUTHWEST BURGER STAND}

    USES
    CRT;

    CONST
    TAB = ' '; {USED FOR SAPCING }

    VAR
    FEDTAX, {TAXES THAT THE FEDRAL GOVERNMENT TAKES }
    SSTAX, {SOCIAL SECURITY TAXES }
    MMBFTAX, {THE AMOUNT OF TAXES TAKEN OUT BY THE MMBF}
    TOTALTAX, {MMBFTAX + SSTAX + FEDTAX }
    REGRATE, {REGULAR RATE OF PAY }
    OTRATE, {OVERTIME RATE OF PAY }
    DOTRATE, {DOUBLE OVERTIME RATE OF PAY }
    REGPAY, {REGULAR PAY }
    OTPAY, {OVERTIME PAY }
    DOTPAY, {DOUBLE OVERTIME PAY }
    GROSSPAY, {PAY BEFORE TAXES }
    NETPAY, {PAY AFTER TAXES ARE DEDUCTED }
    REGHOURS, {INPUTS NUMBER OF REGULAR HOURS }
    OTHOURS, {INPUTS NUMBER OF OVERTIME HOURS }
    DOTHOURS, {INPUTS NUMBER OF DOUBLE OVERTIME HOURS }
    HOURS:
    REAL; {INPUTS NUMBER OF HOURS WORKED }
    IDNUM: {INPUTS McCACTUS NUMBER }
    STRING[4];
    FIRSTNAME, {INPUTS FIRST NAME }
    LASTNAME: {INPUTS LAST NAME }
    STRING[10];
    KEY: {SEARCHES FOR KEYSTROKES }
    CHAR;

    {*******************************TITLE SECTION********************************}

    BEGIN
    CLRSCR;
    WRITELN;
    WRITELN;
    WRITELN;
    WRITELN (TAB:27,'McCACTUS CORPORATION');
    WRITELN (TAB:26,'SOUTHWEST BURGER STAND');
    WRITELN (TAB:28,'PAYROLL DEPARTMENT');
    WRITELN (TAB:24,'Programmed by: Michael Roper');
    WRITELN;

    {*****************************INITATION SECTION******************************}

    REGRATE := 0;
    DOTRATE := 0;
    OTHOURS := 0;
    DOTHOURS := 0;
    HOURS := 0;
    NETPAY := 0;
    GROSSPAY := 0;
    OTRATE := 0;
    REGPAY := 0;
    OTPAY := 0;
    DOTPAY := 0;
    MMBFTAX := 0;
    SSTAX := 0;
    FEDTAX := 0;
    TOTALTAX := 0;
    REGHOURS := 0;

    {************************************INPUT***********************************}

    WRITELN;
    WRITELN;
    WRITE (TAB:21,'FIRST NAME : ');
    READLN (FIRSTNAME);
    WRITE (TAB:21,'LAST NAME : ');
    READLN (LASTNAME);
    WRITE (TAB:21,'McCACTUS ID NUMBER : ');
    READLN (IDNUM);
    WRITE (TAB:21,'TOTAL NUMBER OF HOURS WORKED : ');
    READLN (HOURS);
    WRITE (TAB:21,'REGULAR RATE OF PAY $ : ');
    READLN (REGRATE);

    {***********************HOURS AND GROSSPAY CALCULATIONS**********************}

    IF HOURS < 40
    THEN
    REGHOURS := HOURS
    ELSE
    IF HOURS <= 50
    THEN
    BEGIN
    REGHOURS := 40;
    OTHOURS := HOURS - 40
    END
    ELSE
    BEGIN
    REGHOURS := 40;
    OTHOURS := 10;
    DOTHOURS := HOURS - 50
    END;
    OTRATE := REGRATE * 1.5;
    DOTRATE := REGRATE * 2;
    REGPAY := REGHOURS * REGRATE;
    OTPAY := OTHOURS * OTRATE;
    DOTPAY := DOTHOURS * DOTRATE;
    GROSSPAY := REGPAY + OTPAY + DOTPAY;

    {****************************FED TAX CALCULATIONS****************************}

    IF GROSSPAY <= 500
    THEN
    FEDTAX := 0.15 * GROSSPAY
    ELSE
    IF GROSSPAY <= 1000
    THEN
    FEDTAX := 0.20 * GROSSPAY
    ELSE
    IF GROSSPAY <= 1500
    THEN
    FEDTAX := 0.25 * GROSSPAY
    ELSE
    FEDTAX := 0.28 * GROSSPAY;

    {******************************SS TAX CALCULATIONS***************************}

    IF GROSSPAY <= 800
    THEN
    SSTAX := 0.03 * GROSSPAY
    ELSE
    IF GROSSPAY <= 1400
    THEN
    SSTAX := 0.045 * GROSSPAY
    ELSE
    SSTAX := 0.05 * GROSSPAY;

    {******************************MMBF TAX CALCULATIONS*************************}

    IF GROSSPAY <= 750
    THEN
    MMBFTAX := 0.0125 * GROSSPAY
    ELSE
    MMBFTAX := 0.0175 * GROSSPAY;

    {****************************TOTAL TAXES AND NET PAY*************************}

    TOTALTAX := MMBFTAX + SSTAX + FEDTAX;
    NETPAY := GROSSPAY - TOTALTAX;

    {***********************************TITLE************************************}

    CLRSCR;
    WRITELN (TAB:27,'McCACTUS CORPORATION');
    WRITELN (TAB:26,'SOUTHWEST BURGER STAND');
    WRITELN (TAB:28,'PAYROLL DEPARTMENT');
    WRITELN (TAB:24,'Programmed by: Michael Roper');
    WRITELN;

    {*********************************OUTPUT*************************************}

    WRITE (TAB:12,'EMPLOYEE : ',FIRSTNAME:8,LASTNAME:8);
    WRITELN (TAB:5,'EMPLOYEE ID # : ',IDNUM:4);
    WRITELN;
    WRITELN (TAB:18,'HOURS',TAB:29,'PAYRATES');
    WRITELN (TAB:8,'TOTAL HOURS : ',HOURS:7:2);
    WRITE (TAB:8,'REGULAR HOURS : ',REGHOURS:7:2);
    WRITELN (TAB:7,'REGULAR PAY RATE $ ',REGRATE:7:2);
    WRITE (TAB:8,'OVERTIME HOURS : ',OTHOURS:7:2);
    WRITELN (TAB:7,'OVERTIME RATE $ ',OTRATE:7:2);
    WRITE (TAB:8,'DOUBLETIME HOURS : ',DOTHOURS:7:2);
    WRITELN (TAB:7,'DOUBLETIME RATE $ ',DOTRATE:7:2);
    WRITELN;
    WRITELN (TAB:18,'PAY',TAB:33,'TAX');
    WRITE (TAB:8,'REGULAR PAY $ ',REGPAY:7:2);
    WRITELN (TAB:7,'FEDERAL TAX $ ',FEDTAX:7:2);
    WRITE (TAB:8,'OVERTIME PAY $ ',OTPAY:7:2);
    WRITELN (TAB:7,'SOCIAL SECURITY TAX $ ',SSTAX:7:2);
    WRITE (TAB:8,'DOUBLETIME PAY $ ',DOTPAY:7:2);
    WRITELN (TAB:7,'M.M.B.F. TAX $ ',MMBFTAX:7:2);
    WRITELN;
    WRITELN (TAB:32,'SUMMARY SECTION');
    WRITELN (TAB:29,'GROSS PAY $ ',GROSSPAY:7:2);
    WRITELN (TAB:29,'TOTAL TAX $ ',TOTALTAX:7:2);
    WRITELN (TAB:29,'NET PAY $ ',NETPAY:7:2);
    WRITELN;
    WRITE (TAB:26,'PRESS ANY KEY TO END PROGRAM');
    KEY := UPCASE(READKEY);
    END.
    [/code]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories