//
//  main.m
//  Students9
//
//  David J. Malan
//  Harvard University
//  malan@harvard.edu
//
//  Demonstrates mutable arrays.
//

#import <Foundation/Foundation.h>
#import "Student.h"

int main(int argc, const char * argv[])
{
    @autoreleasepool {
        
        // allocate array for students
        NSMutableArray *students = [NSMutableArray array];
        
        // Alice
        Student *alice = [Student studentWithName:@"Alice" andAge:20];
        [students addObject:alice];
        
        // Bob
        Student *bob = [Student studentWithName:@"Bob" andAge:21];
        [students addObject:bob];
        
        // greet each student
        for (Student *student in students) {
            NSLog(@"Hello, %@.", [student name]);
        }
    }
    return 0;
}

