Deliberate Practice Makes Perfect
Write the code to declare and initialise an array with 3 NSStrings (@“Tom”, @“Dick, @“Harry”)
Write the code to declare and initialise an dictionary with the following items.
name : “John Doe”
age : 16 years old
height: 1.68 m
weight: 60.5 kg
What is the name of the method which will be called before a segue is executed?
Write the code to display an alert view with the following information:
Title: “This is an Alert!”
Message: “Please note that the brown fox has jumped over the lazy dog”
Default Button: “Noted”
Other buttons: “Cancel”, “Oh yeah”
Write the code to print out all the keys and values of a NSMutableDictionary called myMutableDictionary
Write the code to delete an object “John Doe” from a NSMutableDictionary called personDictionary
Write the code for the BankAccount class given the following requirements.
In the BankAccount class, declare an NSString property called name.
In the BankAccount class, declare a double property called balance.
The checkBalance method in the BankAccount class prints the balance in the debug area
The withdraw: method in the BankAccount class is used to specify the amount of money to be withdrawn from the bank account. The method should update the balance property based on the amount of money withdrawn. The balance should never be negative.