Results 1 to 3 of 3
  1. #1
    jeffrey159 is offline Member
    Join Date
    Sep 2013
    Posts
    3
    Rep Power
    0

    Unhappy Calculating in Java app

    hi, i need some help in calculating my code
    Calculating in Java app-untitled_zps0fcc57b9.jpg

    but i don't know what to write in my code for the calculate button.

    what i need to do is that
    it calculate according to the formula

    Total =50+10(X-Y) / Z
    X is raw score
    Y is average score
    Z is the standard deviation

    hope someone would guide me into writing a calculation code for this. thank you

    i wrote this
    String Sum1 = txtrawscore.getText();
    String Sum2 = txtaveragescore.getText();
    String Sum3 = cbo_standard.getSelectedItem().toString();

    txttotal.setText(50+10 (Sum1 - Sum2) / Sum3); <<-- this is just a assumption, i don't know the actual code for this, so i hope someone will correct my error
    i know string is wrong, but i don't know what to write or i tried double but i don't know how to write it in computer language.
    Last edited by jeffrey159; 09-10-2013 at 08:41 PM.

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    United States
    Posts
    2,936
    Rep Power
    4

    Default Re: Calculating in Java app

    You can't do mathematical operations on strings so you need to convert them to a numeric type. You also should check out the web on how to calculate standard deviation.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  3. #3
    jeffrey159 is offline Member
    Join Date
    Sep 2013
    Posts
    3
    Rep Power
    0

    Default Re: Calculating in Java app

    Quote Originally Posted by jim829 View Post
    You can't do mathematical operations on strings so you need to convert them to a numeric type. You also should check out the web on how to calculate standard deviation.

    Regards,
    Jim
    thanks, i got it all to worked.

Similar Threads

  1. Replies: 3
    Last Post: 12-04-2012, 04:31 PM
  2. need help with calculating something
    By mikec420 in forum New To Java
    Replies: 13
    Last Post: 09-29-2011, 09:14 PM
  3. Java Topology suit (JTS) - calculating point
    By ArticRoot in forum New To Java
    Replies: 4
    Last Post: 02-22-2011, 02:54 PM
  4. calculating taxes in java
    By KAM0002 in forum New To Java
    Replies: 16
    Last Post: 12-08-2010, 11:41 AM
  5. [SOLVED] Calculating Std. Deviation using Java
    By random0munky in forum New To Java
    Replies: 1
    Last Post: 12-12-2008, 09:24 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
  •