I documented, thanks Norm!
Type: Posts; User: soupi
I documented, thanks Norm!
that it goes in the order, anything after 'A' will be calculated
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)
ok, do you know how I would do something this similar in PHP?
Wouldnt I change the ValVarPairs.txt file, so instead of c=10 d=13 I would exchange it with x=10, y=10
yes, thank you so much for all your help.
I really appreciate it
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
I think I solved it, what do you think?
package com.ecsgrid;
import java.io.*;
public class testC {
public static void main(String[] args) {
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
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.
Can you show me how it is done, when I tried to follow your steps I shows error messages.
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,...
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...
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[] =...
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[] =...
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[] =...
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[] =...
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?
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[] =...
I still couldnt debug it, do you know why its giving me wrong input?
ok can you give me another example of where I would put the first print statment in my code?
so I would add System.out.println to if (j <= 2) operators[j++] = k;
and
operators[i] = '+'; ?
hi i just started doing java this week :confused:, how would I do a println statment and where would I add it?
thanks
In the console when I did d-c+a+b it gave me 118.0
It was suppose to give me 108
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?