myCalculator.m

Send Snippet To: Save this snippet to Code Collector Pro -- view all durul's snippets
language: Objective-C
license: Other

Code for Snippet:

                
#import <Foundation/Foundation.h>
#import "Calculator.h"
 
int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    Calculator * myCalc = [[Calculator alloc] init];
 
    [myCalc setAccumulator: 10.0];
    [myCalc add: 100];
    [myCalc multiply: 5];
    [myCalc divide: 3.0];
    NSLog (@"The accumulator is %g", [myCalc accumulator]);
 
    [myCalc release];
 
    [pool drain];
    return 0;
}
 
comments powered by Disqus

Info

Link to this snippet:


Download to Code Collector

To use the direct link to your snippet on CodeCollector.net either copy the html from the above section or drag the Download to Code Collector to where you would like to use it.

More Info:

Times Viewed: 64
Date Added: 2015-12-29 18:50:49
Last Modified: 2016-07-19 12:05:44

Web Analytics