Advertisement
gewur33

Untitled

Nov 19th, 2014
443
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. String input = "3+3+3-2-3-4-5-2";
  2. String operatorArray[] = ....
  3. Integer integerArray[] = ....
  4. Integer Ergenis = 0;
  5.  
  6. for (x = 0; x < input.length; x++) {
  7. switch (operator) {
  8. case '+':
  9. Ergebnis = Ergebnis + integerArray[i]+integerArray[i+1];
  10. case '-':
  11. Ergebnis = Ergebnis + integerArray[i]-integerArray[i+1];
  12. case '*':
  13. .........
  14. }
  15. }
  16.  
  17. return Ergebnis;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement