Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
November 24, 2017, 10:34:53 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register Chat  
Pages: [1] 2 3 ... 10
 1 
 on: October 31, 2017, 01:51:39 AM 
Started by mobil1 - Last post by DerrickWax
To earn money through Programming you need to learn a few of them, just knowing one language wont help you much, you need to combine PHP with CSS, HTML, WordPress, etc.

 2 
 on: October 25, 2017, 07:50:25 AM 
Started by j56_vB31xz - Last post by DerrickWax
Code:  Links not allowed for unregistered usersUNSORTED
DownloadFilter=FilterPrivate

Code:  Links not allowed for unregistered usersUNSORTED
DownloadFilter=Private

Which one is correct to filter out Private

?

 3 
 on: October 23, 2017, 04:05:56 AM 
Started by zzh - Last post by zzh
chapter 4 - Exercise 9
Code: (Objective-C)
#import <Foundation/Foundation.h>

@interface Calculator:NSObject

-(void) setAccumulator: (double) value;
-(void) clear;
-(double) accumulator;

-(double) add: (double) value;
-(double) divide: (double) value;
-(double) multiply: (double) value;
-(double) subtract: (double) value;

-(double) changeSign;
-(double) reciprocal;
-(double) xSquared;

@end


@implementation Calculator
{
    double accumulator;
}

-(void) setAccumulator: (double) value;
{
    accumulator=value;
}

-(void) clear;
{
    accumulator = 0;
}

-(double) accumulator;
{
    return accumulator;
}

-(double) add: (double) value
{
    accumulator+=value;
    return accumulator;
}

-(double) subtract: (double) value
{
    accumulator-=value;
    return accumulator;
}

-(double) multiply: (double) value
{
    accumulator*=value;
    return accumulator;
}

-(double) divide: (double) value
{
    accumulator/=value;
    return accumulator;
}

-(double) changeSign
{
    accumulator=-accumulator;
    return accumulator;
}

-(double) reciprocal
{
    accumulator = 1/accumulator;
    return accumulator;
}

-(double) xSquared
{
    accumulator*=accumulator;
    return accumulator;
}

@end

int main (int argc, char * argv[] )
{
    @autoreleasepool {
        Calculator * deskCalc = [Calculator new];
        [deskCalc setAccumulator: 100.0];
        
        NSLog(@"add  200.0  is %g", [deskCalc add: 200.0]);
        NSLog(@"divide 15.0 is %g", [deskCalc divide: 15.0]);
        NSLog(@"subtract 10.0 is %g", [deskCalc subtract: 10.0]);
        NSLog(@"multiply 5  is %g", [deskCalc multiply: 5]);
        NSLog(@"changeSign  is %g", [deskCalc changeSign]);
        NSLog(@"reciprocal  is %g", [deskCalc reciprocal]);
        NSLog(@"xSquared   is %g", [deskCalc xSquared]);
    }
    return 0;
}

 4 
 on: October 23, 2017, 03:46:39 AM 
Started by zzh - Last post by zzh
chapter 4 - Exercise 8 
Code: (Objective-C)
#import <Foundation/Foundation.h>

@interface Calculator:NSObject

-(void) setAccumulator: (double) value;
-(void) clear;
-(double) accumulator;

-(double) add: (double) value;
-(double) divide: (double) value;
-(double) multiply: (double) value;
-(double)subtract: (double) value;

@end


@implementation Calculator
{
    double accumulator;
}

-(void) setAccumulator: (double) value;
{
    accumulator=value;
}

-(void) clear;
{
    accumulator = 0;
}

-(double) accumulator;
{
    return accumulator;
}

-(double) add: (double) value
{
    accumulator+=value;
    return accumulator;
}

-(double) subtract: (double) value
{
    accumulator-=value;
    return accumulator;
}

-(double) multiply: (double) value
{
    accumulator*=value;
    return accumulator;
}

-(double) divide: (double) value
{
    accumulator/=value;
    return accumulator;
}
@end

int main (int argc, char * argv[] )
{
    @autoreleasepool {
        Calculator * deskCalc = [Calculator new];
        [deskCalc setAccumulator: 100.0];
        
        NSLog(@"add  200.0  is %g", [deskCalc add: 200.0]);
        NSLog(@"divide 15.0 is %g", [deskCalc divide: 15.0]);
        NSLog(@"subtract 10.0 is %g", [deskCalc subtract: 10.0]);
        NSLog(@"multiply 5  is %g", [deskCalc multiply: 5]);
    }
    return 0;
}
 

 5 
 on: October 23, 2017, 12:31:34 AM 
Started by Fred - Last post by DerrickWax
Most of my post doesnt go through....especially those replies. I need to make at least 3-4 times posting same post and I make sure that I click the preview before posting it....submit. But,it still the same problems...



---

 6 
 on: October 23, 2017, 12:24:40 AM 
Started by zzh - Last post by zzh
Code: (Objective-C)
#import <Foundation/Foundation.h>

@interface Rectangle:NSObject

-(void) setWidth : (int) x;
-(void) setheight : (int) y;
-(int) width;
-(int) height;
-(int) area;
-(int) perimeter;
@end

@implementation Rectangle
{
    int width,height;
}

-(void) setWidth : (int) x
{
    width=x;
}


-(void) setheight : (int) y
{
    height=y;
}

- (int) width;
{
    return width;
}

-(int) height
{
    return height;
}

-(int) area
{
    return width*height;
}

-(int) perimeter
{
    return 2*width+2*height;
}

@end

int main(int argc, char *argv[])
{
    @autoreleasepool
    {
        Rectangle *myRectangle  = [Rectangle new];
        [myRectangle setWidth: 5];
        [myRectangle setheight: 9];
        
        NSLog(@"width = %i",[myRectangle width]);
        NSLog(@"height = %i",[myRectangle height]);
        NSLog(@"area = %i",[myRectangle area]);
        NSLog(@"perimeter = %i",[myRectangle perimeter]);
        
    }
    return 0;
    
}


 7 
 on: October 22, 2017, 09:06:02 PM 
Started by maridi91 - Last post by DerrickWax
I am starting to work on the car and still looking for the instrument cluster, anyone? Thanks.

 8 
 on: October 22, 2017, 02:53:04 PM 
Started by timBob - Last post by DerrickWax
When I try to read chapter 12 I get a page with white text on a white background that says the page in not available.

 9 
 on: October 22, 2017, 08:28:20 AM 
Started by ceres75 - Last post by DerrickWax
Constructive feedback on the levels will be appreciated. Also I should be posting the level codes soon.

As for water, I plan for a series of LD updates to come soon.  Then a chapter 2 with significantly more levels than 6.

 10 
 on: September 13, 2017, 11:35:53 PM 
Started by tleoncio - Last post by Yarnall
Thanks for the tutorial Leon.

Pages: [1] 2 3 ... 10
Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Entire forum contents ゥ 2009 classroomM.com. All rights reserved.