iOS Object-Oriented Objective-C Diving Deeper - Classes, Properties and Methods Creating Methods!

Stefan Mach
Stefan Mach
3,691 Points

I botched this code challenge, please help

I tried this every which way, and the editor does not give any feedback. I put it into xcode, and it can't even tell it is a method, because I am guessing this code challenge has an answer that is correct in isolation in this context because it is a quiz, but cannot be tested in xcode because xcode wants the other code that supports the method. I am really stuck here, and have repeatedly watched the videos.

variable_assignment.mm
-(float)calculateTip:(float)subTotal, (float) tip{


tip = subTotal * 0.2;

  return;

}

1 Answer

james south
james south
Front End Web Development Techdegree Graduate 33,245 Points

well it looks like you are taking two arguments when you only need one, and you are not returning anything. so i think i would take tip out of the parameter list so that it only takes subtotal, then return tip as calculated. also it wants the parameter to be subtotal, not subTotal.