I have tried to place my program into Procedures, But it keeps crashing at launch.
It compiles successfully though.
Here's the Code.
It's not the entire program, I just tried one single module, but i can't get it to run .
Also I'm suppose to store the data entered in two arrays which is declared in the MAIN function. Do i need to put this in as parameters for the functions.
I'm lost, Not good with functions and subprograms. It has never been taught to me before. I just have the basic understanding.
Program Expenditure;
Var
CustomerNames : array[1..10] of String;
ExpenditureAmt: array[1..10] of String;
{Modules/Procedures For The Main Function}
Procedure InputData;
Var
Terminate :Integer;
CustomerID :Integer;
Begin
Terminate := 0;
CustomerID:= 0;
While Terminate <> 0 do
Begin
CustomerID := CustomerID + 1;
Writeln ('Input the First and Last Names of the Customer');
Readln (CustomerNames[CustomerID]);
Writeln('Input the expenditure of ' , CustomerNames[CustomerID]);
Readln (ExpenditureAmt[CustomerID]);
Writeln ('To Terminate Data Entry Press 0 or ANY Other Number TO Continue');
Readln (Terminate);
End;
End;
{START MAIN}
Begin
InputData
End.
{END MAIN}


Sign In
Create Account

Back to top









