Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ReadExpenseKind(prompt: String): ExpenseKind;
- var
- selection: Integer;
- begin
- WriteLn('1 - Fixed Expense');
- WriteLn('2 - Flexible Expense');
- WriteLn('3 - Discretionary Expense');
- selection := ReadInteger(prompt);
- //Validates choice
- while (selection < 1) or (selection > 3) do
- begin
- WriteLn('Please enter a value between 1 & 3');
- selection := ReadInteger(prompt);
- end;
- //Assigns choice
- case selection of
- 1: result := Fixed;
- 2: result := Flexible;
- 3: result := Discretionary;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement