Newbie here...I'm working on my 1st iphone app and have hit a snag.
Basically, there are 4 text input fields. the first 3 are for numbers (num1, num2, num3), the 4th one (call it form1) someone selects a number between 1 and 3 for 3 different formulas to be applied to those other 3 numbers.
ex: if someone selects "1" for form1, then the formula is:
((num1-num3)*num2))*.8
if someone selects "2" for form1 then its:
((num1-num3)*num2))*.5
if someone selects "3" for form1 then its:
((num1-num3)*num2))*.3
I'm completely stuck on the syntax and like I said, ultra-new to sw dev in general so any help would be GREATLY appreciated.
Newbie here...I'm working on my 1st iphone app and have hit a snag.
Basically, there are 4 text input fields. the first 3 are for numbers (num1, num2, num3), the 4th one (call it form1) someone selects a number between 1 and 3 for 3 different formulas to be applied to those other 3 numbers.
ex: if someone selects "1" for form1, then the formula is:
((num1-num3)*num2))*.8
if someone selects "2" for form1 then its:
((num1-num3)*num2))*.5
if someone selects "3" for form1 then its:
((num1-num3)*num2))*.3
I'm completely stuck on the syntax and like I said, ultra-new to sw dev in general so any help would be GREATLY appreciated.
Thanks in advance!
If you have an input field called form1, baya's approach would look like this:
Bear in mind that this code is probably not perfect. There are probably a couple of syntax errors, and the code probably won't fit into your app without some changes. Don't post back, telling me that there is this or that error when you try to compile it. I've spoon-fed you 90% of it. The last 10% is up to you.
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.
Bear in mind that this code is probably not perfect. There are probably a couple of syntax errors, and the code probably won't fit into your app without some changes. Don't post back, telling me that there is this or that error when you try to compile it. I've spoon-fed you 90% of it. The last 10% is up to you.
This is perfect... I can figure the rest out from here. Thanks again!