Results 1 to 2 of 2
  1. #1
    ashpack is offline Member
    Join Date
    Aug 2013
    Rep Power

    Default Writing calculations help!!! (javascript)


    I'm pretty new to using Java. I'm currently making a mobile phone app with a number of calculations I have done all of them apart from one and I have no idea how to write the code to do what I'm looking to do I would appreciate it if somebody could help me!

    Here's the code I have used for my other calculation but my next one is slightly more complicated and its melting my brain!!
    <SCRIPT language=JavaScript>
    function perc2() {
    a = document.form1.c.value;
    b = document.form1.d.value;
    c = a/b;
    d = c*100;
    document.form1.total2.value = d

    <FORM name=form1>
    <TABLE cellSpacing=1 cellPadding=1 border=1>
    <TD align=middle colSpan=3><B><FONT size=4>CDMR Calculation</FONT></B>
    <TD><INPUT size=2 name=c> Daily Dead <INPUT size=2
    name=d>Remaining Stock</TD>
    <TD>Answer: <INPUT size=5 name=total2> %</TD>
    <TD><INPUT onclick=perc2() type=button value=Calculate></TD>
    <TD align=middle
    colSpan=3><INPUT type=reset value=Reset></TD></TR></TBODY></TABLE></FORM>
    The next calculation is far more complicated

    Average Weight / Average Age x Survival Rate / Feed Conversion x 10

    Eg: 2.10 39 x 97 1.73 x 10 Answer= 30.191

    I hope somebody can help me.

    Thanks in advance

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Washington, DC
    Rep Power

    Default Re: Writing calculations help!!!

    Java != javascript. I'll move this to the forum lobby.
    How to Ask Questions the Smart Way
    Static Void Games - GameDev tutorials, free Java and JavaScript hosting!
    Static Void Games forum - Come say hello!

Similar Threads

  1. Help with Date calculations
    By iainnitro in forum New To Java
    Replies: 4
    Last Post: 11-17-2012, 08:38 AM
  2. OO for calculations?
    By StateMachine in forum New To Java
    Replies: 1
    Last Post: 12-31-2011, 08:17 AM
  3. Time calculations
    By Jason in forum New To Java
    Replies: 6
    Last Post: 09-29-2011, 09:42 PM
  4. Rounding calculations
    By lynxbci in forum New To Java
    Replies: 9
    Last Post: 08-20-2011, 03:49 PM
  5. decimal calculations?
    By arnab321 in forum CLDC and MIDP
    Replies: 5
    Last Post: 11-19-2008, 03:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts