Search:

Type: Posts; User: soupi

Page 1 of 2 1 2

Search: Search took 0.19 seconds.

  1. Replies
    50
    Views
    483

    Re: Output of numbers are incorrect sometimes.

    I documented, thanks Norm!
  2. Replies
    50
    Views
    483

    Re: Output of numbers are incorrect sometimes.

    that it goes in the order, anything after 'A' will be calculated
  3. Replies
    50
    Views
    483

    Re: Output of numbers are incorrect sometimes.

    A+b+c+d worked still but,
    when I did A+b+x+y it showed this error.
    A
    +
    +
    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 23
    at com.ecsgrid.testC.main(testC.java:68)
  4. Replies
    50
    Views
    483

    Re: Output of numbers are incorrect sometimes.

    ok, do you know how I would do something this similar in PHP?
  5. Replies
    50
    Views
    483

    Re: Output of numbers are incorrect sometimes.

    Wouldnt I change the ValVarPairs.txt file, so instead of c=10 d=13 I would exchange it with x=10, y=10
  6. Replies
    50
    Views
    483

    Re: Output of numbers are incorrect sometimes.

    yes, thank you so much for all your help.
    I really appreciate it
  7. Replies
    50
    Views
    483

    Re: Output of numbers are incorrect sometimes.

    when I try to subtract more then 2 numbers it outputs only the subtraction of the first two numbers.
    for example
    100.0
    5.0
    10.0
    13.0
    Enter letters and operators:
    A-A-A-A
    -200.0
  8. Replies
    50
    Views
    483

    Re: Output of numbers are incorrect sometimes.

    I think I solved it, what do you think?


    package com.ecsgrid;

    import java.io.*;

    public class testC {

    public static void main(String[] args) {
  9. Replies
    50
    Views
    483

    Re: Output of numbers are incorrect sometimes.

    Enter letters and operators:
    A+a+a+a
    Your input is: A+a+a+a
    1res=100.0
    2res=105.0
    2res=115.0
    2res=128.0
    128.0

    it should be 400 but it still appeared to be 128.0
  10. Replies
    50
    Views
    483

    Re: Output of numbers are incorrect sometimes.

    Enter letters and operators:

    Your input is:
    1res=100.0
    2res=105.0
    2res=115.0
    2res=128.0
    128.0

    thats my output in the console.
  11. Replies
    50
    Views
    483

    Re: Output of numbers are incorrect sometimes.

    Can you show me how it is done, when I tried to follow your steps I shows error messages.
  12. Replies
    50
    Views
    483

    Re: Output of numbers are incorrect sometimes.

    package com.ecsgrid;

    import java.io.*;

    public class testC {

    public static void main(String[] args) {
    int i = 0,j = 0;
    double result, values[] = new double[4];
    char k,...
  13. Replies
    50
    Views
    483

    Re: Output of numbers are incorrect sometimes.

    error is below, can u show me the correct way to do this?

    Error

    Exception in thread "main" java.lang.Error: Unresolved compilation problems:
    Syntax error, insert "}" to complete Block...
  14. Replies
    50
    Views
    483

    Re: Output of numbers are incorrect sometimes.

    package com.ecsgrid;

    import java.io.*;

    public class testC {

    public static void main(String[] args) {
    int i = 0,j = 0;
    double result, values[] = new double[4];
    char k, operators[] =...
  15. Replies
    50
    Views
    483

    Re: Output of numbers are incorrect sometimes.

    package com.ecsgrid;

    import java.io.*;

    public class testC {

    public static void main(String[] args) {
    int i = 0,j = 0;
    double result, values[] = new double[4];
    char k, operators[] =...
  16. Replies
    50
    Views
    483

    Re: Output of numbers are incorrect sometimes.

    package com.ecsgrid;

    import java.io.*;

    public class testC {

    public static void main(String[] args) {
    int i = 0,j = 0;
    double result, values[] = new double[4];
    char k, operators[] =...
  17. Replies
    50
    Views
    483

    Re: Output of numbers are incorrect sometimes.

    package com.ecsgrid;

    import java.io.*;

    public class testC {

    public static void main(String[] args) {
    int i = 0,j = 0;
    double result, values[] = new double[4];
    char k, operators[] =...
  18. Replies
    50
    Views
    483

    Re: Output of numbers are incorrect sometimes.

    Enter letters and operators:
    A+a+a+a
    1res=100.0
    2res=100.0

    it is suppose to be 400 for the output.

    --- Update ---

    Also your saying after I put if or else put {} right after?
  19. Replies
    50
    Views
    483

    Re: Output of numbers are incorrect sometimes.

    package com.ecsgrid;

    import java.io.*;

    public class testC {

    public static void main(String[] args) {
    int i = 0,j = 0;
    double result, values[] = new double[4];
    char k, operators[] =...
  20. Replies
    50
    Views
    483

    Re: Output of numbers are incorrect sometimes.

    I still couldnt debug it, do you know why its giving me wrong input?
  21. Replies
    50
    Views
    483

    Re: Output of numbers are incorrect sometimes.

    ok can you give me another example of where I would put the first print statment in my code?
  22. Replies
    50
    Views
    483

    Re: Output of numbers are incorrect sometimes.

    so I would add System.out.println to if (j <= 2) operators[j++] = k;
    and
    operators[i] = '+'; ?
  23. Replies
    50
    Views
    483

    Re: Output of numbers are incorrect sometimes.

    hi i just started doing java this week :confused:, how would I do a println statment and where would I add it?
    thanks
  24. Replies
    50
    Views
    483

    Re: Output of numbers are incorrect sometimes.

    In the console when I did d-c+a+b it gave me 118.0
    It was suppose to give me 108
  25. Replies
    50
    Views
    483

    Re: Output of numbers are incorrect sometimes.

    Thank you for your quick reply Norm.

    I copied the output I received in Console:

    Enter letters and operators:
    d-c+a+b
    118.0


    Is this what you wanted?
Results 1 to 25 of 26
Page 1 of 2 1 2