Guest User

Untitled

a guest
Sep 18th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Bank code
  2. - (IBAction)deposit:(id)sender {
  3.     int depositAmount = depositField.intValue;
  4.    
  5.     if (depositField.intValue > moneyLabel.intValue) {
  6.         [depositField setStringValue:@"Insufficient funds!"];
  7.     }
  8.    
  9.     else if (depositField.intValue < moneyLabel.intValue) {
  10.         [depositField setStringValue:@"Success!"];
  11.         balanceLabel.stringValue = [NSString stringWithFormat:@"%d", [depositField intValue]+depositAmount]; // Deposits
  12.         int FinalTotal = moneyLabel.intValue - depositAmount;
  13.         moneyLabel.stringValue = [NSString stringWithFormat:@"%d", [depositField intValue]+FinalTotal]; // Transacts from deposit $
  14.     }
  15.    
  16. }
Add Comment
Please, Sign In to add comment