Model class representing a financial calculator Here is my Model class's new header file:

@interface MMCalculator : NSObject

@property (readonly) CGFloat calculatedPay;
@property (readonly) CGFloat calculatedSavingsForStuff;
@property (readonly) CGFloat calculatedSavingsForProfitFormula;
@property (readonly) CGFloat calculatedSavingsForTaxes;

- (void)calculateValuesWithMonthlyRevenue:(CGFloat)monthlyRevenue;

@end


Here is my Model class's new implementation file:

#import "MMCalculator.h"

#pragma mark - Const Variables
static CGFloat const kPercentageToPayYourself = 0.50;
static CGFloat const kPercentageToSaveForStuff = 0.20;
static CGFloat const kPercentageToSaveForProfitFormula = 0.20;
static CGFloat const kPercentageToSaveForTaxes = 0.10;

@interface MMCalculator ()

@property (readwrite) CGFloat calculatedPay;
@property (readwrite) CGFloat calculatedSavingsForStuff;
@property (readwrite) CGFloat calculatedSavingsForProfitFormula;
@property (readwrite) CGFloat calculatedSavingsForTaxes;

@end

@implementation MMCalculator

#pragma mark - Calculator Methods
- (void)calculateValuesWithMonthlyRevenue:(float)monthlyRevenue
{
    //Call all 4 calculation methods and set calculated properties
    self.calculatedPay = [MMCalculator calculateYourPay:monthlyRevenue];
    self.calculatedSavingsForStuff = [MMCalculator calculateSavingsForStuff:monthlyRevenue];
    self.calculatedSavingsForProfitFormula = [MMCalculator calculateSavingsForProfitFormula:monthlyRevenue];
    self.calculatedSavingsForTaxes = [MMCalculator calculateSavingsForTaxes:monthlyRevenue];

}

+ (CGFloat)calculateYourPay:(CGFloat)monthlyRevenue
{
    return kPercentageToPayYourself * monthlyRevenue;
}

+ (CGFloat)calculateSavingsForStuff:(CGFloat)monthlyRevenue
{
    return kPercentageToSaveForStuff * monthlyRevenue;;
}

+ (CGFloat)calculateSavingsForProfitFormula:(CGFloat)monthlyRevenue
{
    return kPercentageToSaveForProfitFormula * monthlyRevenue;
}

+ (CGFloat)calculateSavingsForTaxes:(CGFloat)monthlyRevenue
{
    return kPercentageToSaveForTaxes * monthlyRevenue;
}

@end


Key things I am looking for advice on:


Are my constants defined in the correct location in my Model class's implementation file?
Even though the compiler does not force me to, would it be better to declare my private methods in the class extension? I want to make sure I'm following best practices.
Now that the Model's instance methods have been changed to class methods, should I change the public calculateValuesWithMonthlyRevenue: method to a class method as well?
Any other general comments are welcome.
Are my constants defined in the correct location in my Model class's implementation file?


It is impossible to tell.  Where a variable needs to be declared is entirely dependent upon its intended scope.  


If a variable is used only within a single block (within an if, else, or loop, or anything else of this nature), it should be declared within that block.
If a variable is used only in a single function, it should be declared in that function.
If a variable is used in multiple functions in a file, it should be declared in the .m file so it can be seen throughout the file, but not within other files in the project.
If a variable is used in multiple files, it should be declared in a .h file so that it may be imported across the multiple files.





  Even though the compiler does not force me to, would it be better to declare my private methods in the class extension? I want to make sure I'm following best practices.


There's no particular need to declaring methods in class extensions in Objective-C.  I don't know of any real benefit to doing so.




  Now that the Model's instance methods have been changed to class methods, should I change the public calculateValuesWithMonthlyRevenue: method to a class method as well?


This one can't be changed, at least not quite as easily.  You can't refer to a class's instance variables within a class method.

Perhaps what you should do is instead change it to more of a factory method that might look a bit like this:

+ (instancetype)calculatedValuesForMonthlyRevenue:(CGFloat)monthlyRevenue {
    return [[self alloc] initWithValuesForMonthlyRevenue:monthlyRevenue];
}

- (instancetype)initWithValuesForMonthlyRevenue:(CGFloat)monthlyRevenue {
    self = [super init];

    if (self) {
        _calculatedPay = [MMCalculator calculateYourPay:monthlyRevenue];
        _calculatedSavingsForStuff = [MMCalculator calculateSavingsForStuff:monthlyRevenue];
        _calculatedSavingsForProfitFormula = [MMCalculator calculateSavingsForProfitFormula:monthlyRevenue];
        _calculatedSavingsForTaxes = [MMCalculator calculateSavingsForTaxes:monthlyRevenue];
    }

    return self;
}





  Any other general comments are welcome.


The class name, MMCalculator needs some work.  This does a more specific job then a regular calculator.  This is more like a personal finance calculator if anything.




  Any other general comments are welcome.


You really shouldn't represent money with floating point numbers.

Instead, you should probably create a class for holding money.

Money.h

@interface Money

@property (readonly) int dollars;
@property (readonly) int cents;

+ (instancetype)moneyWithDollars:(int)dollars cents:(int)cents;
- (instancetype)initWithDollars:(int)dollars cents:(int)cents;

@end


Money.m

@implementation Money {
    long long _totalCents;
}

- (int)dollars {
    return _totalCents/100;
}

- (int)cents {
    return _totalCents%100;
}

+ (instancetype)moneyWithDollars:(int)dollars cents:(int)cents {
    return [[self alloc] initWithDollars:dollars cents:cents];
}

- (instancetype)initWithDollars:(int)dollars cents:(int)cents {
    self = [super init];

    if (self) {
        _totalCents = cents + (100 * dollars);
    } 

    return self;
}

@end


The class could be rounded out with various math methods as well.