Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. import ballerina/io;
  2.  
  3. const INVALID_ACC_ID = "InvalidAccountId";
  4. const INVALID_ACC_ID_CODE = 1234;
  5.  
  6. function updateAccount(int accountId, decimal amount) {
  7.  
  8. if (accountId < 1000) {
  9. panic error(INVALID_ACC_ID, code = INVALID_ACC_ID_CODE);
  10. }
  11.  
  12. // Account update logic.
  13. io:println("Updated Account for ID ", accountId, " , Amount: ", amount);
  14. }
  15.  
  16. public function main() {
  17. updateAccount(2500, 1500.00);
  18. updateAccount(25, 1000.00);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement