Help on Lisp programming question.

I really need help with this Pascal Programming Question! Plzzzzz Help me?

  • Write an ALGORITHM for the following program and write in PASCAL PROGRAMMING (a) input number of sales transaction, each consisting of a salesperson's number (between 1 and 150), a Department number (between 1 and 5) and a sales amount. (b) accumulate and print out the total sales for each employee with non-zero sales, ad the total sales for each department together with the name of the department (Departments are as follows: 1-Electrical, 2- Household Good, 3-Toys and Games, 4-Menswear, 5- Ladies fashion)

  • Answer:

    program demo1; uses Crt; type TSalesRecord = record SalesId: Integer; DepartmentId: Integer; Amount: Real; end; var Sales: array[1..99] of TSalesRecord; i, RecCount: Integer; Choice: char; procedure DisplayError(EMsg: string); begin WriteLn(EMsg); Delay(1500); end; procedure GetInputId(Msg,EMsg: string; Min,Max: Integer; var Value: Integer); var valid: boolean; r: Integer; begin valid:=false; repeat Write(Msg); ReadLn(r); valid := ((r>=Min) and (r<=Max)); if not valid then DisplayError(EMsg); until valid; Value:=r; end; procedure GetInputAmount(Msg,EMsg: string; Min,Max: Integer; var Value: Integer); var valid: boolean; r: Real; begin valid:=false; repeat Write(Msg); ReadLn(r); valid := ((r>=Min) and (r<=Max)); if not valid then DisplayError(EMsg); until valid; Value:=r; end; procedure InputSalesTrans; begin if RecCount<100 then begin RecCount := RecCount+1; GetInputId('Enter sales person id: ','Value must be in 1-150',1,150,Sales[RecCount].SalesId); GetInputId('Enter Department ID: ','Value must be in 1-5',1,5,Sales[RecCount].DepartmentId); GetInputId('Enter Sales Amount: $','Must be a value.',,,Sales[RecCount].Amount); end; {if} end; begin ClrScr; repeat InputSalesTrans; Write('Again [Y/N]? '); ReadLn(choice); until UpCase(Choice)='N'; for i:=1 to RecCount do begin end; end.

User at Yahoo! Answers Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.