Need help completing Objective-C project


#1

I posted here last night completely lost , however you guys helped out a lot. I still am stuck implementing one last thing.
Develop a class named “WeightedBox” by extending the above Box class.
• Add a new iVar like weight (float in pounds). Create a property for the weight.
• Add a new instance method named classifyWeight. It should not accept any parameter and return a string using following rule: o If the weight of the box is more than >= 100 pounds, then return “Heavy” else return “Light”
• Override the inherited description to return a string that will also include the info about the weight (along with other properties).
Those are the instructions, I did everything I could but it will not show up when I run, here is my following code.
main.m
import <Foundation/Foundation.h>
import "aBox.h"
int main (int argc, const char * argv[]) { @autoreleasepool {
MyBox *box = [[[MyBox alloc] init] autorelease];

box.length = M_PI;
box.width = M_PI;
box.height = M_PI;
box.weight = M_PI;
NSLog (@"%@", box);

box = [MyBox randomBox];
NSLog (@"%@", box);

box = [MyBox randomBox];
NSLog (@"%@", box);
} fflush (NULL); return 0; }
abox.h
import <Foundation/Foundation.h>
@interface MyBox : NSObject
@property (nonatomic, copy) NSString *name;
@property float length; @property float width; @property float height; @property float weight;
(float) classifyWeight;
(float) computeVolume;
(NSString *) estimateCategory;
(MyBox *)randomBox;
@end
abox.m
#import “aBox.h”

@implementation MyBox

@synthesize name, length, width, height;

static const char *_names [] = {“Box 1”, “Box 2”, “Box 3”, “Box 4”};

  • (MyBox *)randomBox
    {
    MyBox *randomBox = [[[self class] alloc] init];

    randomBox.length = M_PI * (arc4random_uniform (arc4random_uniform (30)) + 1);
    randomBox.height = M_PI * (arc4random_uniform (arc4random_uniform (50)) + 1);
    randomBox.width = M_PI * (arc4random_uniform (arc4random_uniform (70)) + 1);

    NSUInteger index = arc4random_uniform (sizeof (_names) / sizeof (_names [0]));
    NSString *randomName = [NSString stringWithUTF8String:_names [index]];
    randomBox.name = randomName;

    return [randomBox autorelease];
    }

  • (id)init
    {
    self = [super init];
    if (self)
    {

    }
    return self;
    }

  • (float) computeVolume
    {
    return self.length * self.width * self.height;
    }

  • (float) classifyWeight
    {
    return self.weight;
    }

  • (NSString *) estimateCategory
    {
    float vol = [self computeVolume];
    if(vol >= 8000)
    return @“Large”;
    else if((vol < 8000) && (vol > 1000))
    return @“Medium”;
    else
    return @“Small”;
    float weight = [self classifyWeight];
    if(weight >= 100)
    return @“Heavy”;
    else
    return @“Light”;
    }

  • (NSString *)description
    {
    return [NSString stringWithFormat:@“Name: %@ Estimated Volume: %.2f Category: %@”, [self name], [self computeVolume], [self estimateCategory], [self classifyWeight]];
    }
    @end

I am getting a data argument not used… however it still compiles and succeeds.