I am trying to use many employees, but I do not how I can use case in my arrays. Could you help me, please?
program StaffSal(input, output);
uses
Crt;
const
SalRate = 0.1;
A = 150;
B = 85;
C = 95;
D = 120;
type
Employee = record
Names, Position: string;
OctSales, NovSales, DecSales, JanSales, MarchSales, AprilSales,
TotalSales, Salary, thPay: Real;
end;
var
Staff : array[1..6] of Employee;
q : integer;
TotalSalary : real;
begin
for q := 1 to 6 do begin
Write('Enter Employee name : ') ; readln(Staff[q].Names);
Write('Horas laborales del día lunes: ') ; readln(Staff[q].OctSales);
Write('Horas laborales del día martes: ') ; readln(Staff[q].NovSales);
Write('Horas laborales del día miércoles: '); readln(Staff[q].DecSales);
Write('Horas laborales del día jueves: '); readln(Staff[q].JanSales);
Write('Horas laborales del día viernes: '); readln(Staff[q].MarchSales);
Write('Horas laborales del día sábado '); readln(Staff[q].AprilSales);
Write('Ingresa categoria : '); readln(Staff[q].Position);
Staff[q].TotalSales := (Staff[q].AprilSales + Staff[q].MarchSales + Staff[q].OctSales + Staff[q].NovSales + Staff[q].DecSales + Staff[q].JanSales);
//Staff[q].Salary := Staff[q].TotalSales * SalRate;
if Upcase(Staff[q].Position) = 'A' then
Staff[q].thPay := Staff[q].TotalSales * A
else
Staff[q].thPay := Staff[q].Salary * D;
end;
TotalSalary := 0;
for q := 1 to 6 do
TotalSalary := TotalSalary + Staff[q].Salary;
for q := 1 to 6 do
writeln('The total sales for the quarter is : ',
Staff[q].Names, Staff[q].TotalSales: 10: 2);
for q := 1 to 6 do
begin
writeln('Name ', Staff[q].Names);
writeln('categoria ', Staff[q].Position);
//writeln('Salary ', Staff[q].Salary: 8: 2);
writeln('Take home pay ', Staff[q].thPay: 8: 2);
end;
writeln('Type the word FINISH to end the program :');
readln;
readln;
end.