title: I'm having trouble with some fairly basic math functions in Xcode
body: <p>Basically, the program has 5 textfields for numbers. I want a math function that totals all 5 textboxes, then multiplies by 1.39, then again by 1.12, but I can't get the textfields to add properly. It works so far if you only put a number in one of the textfields, but it gets a little confused when it comes to adding more than one textfield. Here's my code:</p>
  
  <pre><code>- (IBAction)calculate {
      float b = ([BCB.text floatValue]);
      float d = b+([MCD.text floatValue]);
      float f = b+d+([SF.text floatValue]);
      float w = b+d+f+([SW.text floatValue]);
      float a = b+d+f+w+([AP.text floatValue]);
      float p = 1.39f;
      float h = 1.12f;
      float t = a*p*h;    
  
      Total.text = [ [NSString alloc] initWithFormat:@"%.2f", t];
  }
  </code></pre>
  
  <p>Bear in mind I'm 100% beginner when it comes to Xcode, and I've kind of Frankensteined this code together from various tutorials, and this might be completely wrong.</p>