Exercises
1. Which of the following are invalid names? Why?
Int playNextSong 6_05_calloc Xx alphaBetaRoutineclearScreen _1312 zReInitialize _ A$
2. Based on the example of the car in this chapter, think of an object you use every day. Identify a class for that object and write five actions you do with that object.
3. Given the list in exercise 2, use the following syntax to rewrite your list in this format:
[instance method];
4. Imagine that you own a boat and a motorcycle in addition to a car. List the actions you perform with each of these. Do you have any overlap between these actions?
5. Based on question 4, imagine that you have a class called Vehicle
and an object called ...
Get Programming in Objective-C, Fifth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.