Hello all.
I am having some issues with a pascal program i am creating. I have got a prompt, "Please Enter The Name of The Employee Whoose Allowance Will Be Calculated: "
the entered data needs to be stored in an array. The program then loads my menu of three choices, and the prompt underneath needs to say, "Please Enter <NAME OF EMPLOYEE>'s Means of Transport: "
the type of transport chosen (a number) also needs to be stored in this array.
the program then asks how much ileage the customer has driven using the set mode of transport. this must also be stored in the array. the calculated allowance should be calculated and stored in an array.
the programmust loop after the first array has been stored and then accept new entries to be stored as mentioned above.
The program should then close if the user enter's FINISH as the employee name.
this then has to go on and display an onscreen report with the employee name, vehicle type, weekly mileage and allowance.
i have allocated all my points to this question as i can see its a big task.
thank you in advance.
Seraph
Also, you tend to write the same code over and over again. Wouldn't it be simpler to do it this way:
WRITE('PLEASE ENTER MILEAGE:> ');
READLN(MILES[LOOP]);
IF (SELECTION[LOOP]=1) THEN ALLOWANCE[LOOP]:=MILES[LOO
IF (SELECTION[LOOP]=2) THEN ALLOWANCE[LOOP]:=MILES[LOO
IF (SELECTION[LOOP]=3) THEN ALLOWANCE[LOOP]:=MILES[LOO
CLRSCR;
or this way:
WRITE('PLEASE ENTER MILEAGE:> ');
READLN(MILES[LOOP]);
Case SELECTION[LOOP] of
1: ALLOWANCE[LOOP]:=MILES[LOO
2: ALLOWANCE[LOOP]:=MILES[LOO
3: ALLOWANCE[LOOP]:=MILES[LOO
end;
CLRSCR;
Or you can make an array with all used factors:
CONST FactorsArray: array [1..3] of Real = (0.15,0.20,0.30);
WRITE('PLEASE ENTER MILEAGE:> ');
READLN(MILES[LOOP]);
ALLOWANCE[LOOP]:=MILES[LOO
CLRSCR;