Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String input = "3+3+3-2-3-4-5-2";
- String operatorArray[] = ....
- Integer integerArray[] = ....
- Integer Ergenis = 0;
- for (x = 0; x < input.length; x++) {
- switch (operator) {
- case '+':
- Ergebnis = Ergebnis + integerArray[i]+integerArray[i+1];
- case '-':
- Ergebnis = Ergebnis + integerArray[i]-integerArray[i+1];
- case '*':
- .........
- }
- }
- return Ergebnis;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement