Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. function ReadExpenseKind(prompt: String): ExpenseKind;
  2. var
  3. selection: Integer;
  4. begin
  5. WriteLn('1 - Fixed Expense');
  6. WriteLn('2 - Flexible Expense');
  7. WriteLn('3 - Discretionary Expense');
  8. selection := ReadInteger(prompt);
  9. //Validates choice
  10. while (selection < 1) or (selection > 3) do
  11. begin
  12. WriteLn('Please enter a value between 1 & 3');
  13. selection := ReadInteger(prompt);
  14. end;
  15. //Assigns choice
  16. case selection of
  17. 1: result := Fixed;
  18. 2: result := Flexible;
  19. 3: result := Discretionary;
  20. end;
  21. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement