Advertise here

Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

NEED HELP!! Code development - formula based calculation

ddoublevddoublev PerthPosts: 1New Users Noob

I am in need of urgent help, I work in the water industry and I am continually being contacted by people I work with to carry out calculations for them because they are too lazy to do the math.

I have identified that an app to calculate a result through a formula using three variables would do the job. I have been working at it for a while now and can't seem to get any of it to work.

Formula is pretty basic x=a*b/c

Can someone please help out with how the code should look? I do not intend to make any money etc from this app and it will look pretty basic. Only think it will be downloaded maybe 10-20 times


  • dev666999dev666999 Posts: 3,632New Users @ @ @ @ @
    edited November 2015
    Declare your variables as floats:

    float x;
    float a;
    float b;
    float c;

    a = a variable or constant;
    b = a second variable or constant;
    c = a third variable or constant;

    The formula in Objective C is same as what you already have... solve for x

    x = a*b/c
  • C6Silver05C6Silver05 SeattlePosts: 632New Users @ @ @
    I am going to guess that the math really isn't the issue here for your code. If you have no experience the problem for you is how to actually use Xcode and Objective C / Swift to build even a basic UI to get the necessary inputs. Never mind actually building something that could pass Apple review. I have to assume this is as if you actually knew that stuff you wouldn't be asking how to perform a simple math calculation within the program.

    If you are impatient to start where you need to here in terms of learning, you might go and find some small sample code that already puts up a basic UI that you can interact with. Then make small modifications to to fit your needs. Likely much easier than starting from scratch with no experience and it is a very valid way to see how things work and fit together.
  • RickSDKRickSDK Posts: 1,240Registered Users @ @ @ @
    if the formula is that simple just tell them to use a calculator. or do the math in their heads.
  • Duncan CDuncan C Posts: 9,116Tutorial Authors, Registered Users @ @ @ @ @ @ @
    ... Or use an Excel spreadsheet. Seems like that's the easiest way to do this.
    Duncan C

    Animated GIF created with Face Dancer, available for free in the app store.

    I'm available for one-on-one help at CodeMentor
Sign In or Register to comment.