You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
410 B

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. package programmiermethoden_und_Werkzeuge;
  2. public class Taschenrechner {
  3. int addition(int a, int b) {
  4. return a + b;
  5. }
  6. int multiplikation(int a, int b) {
  7. return a * b;
  8. }
  9. int division(int a, int b) {
  10. return a / b;
  11. }
  12. int potenzieren(int a, int b) {
  13. int temp = 1;
  14. if(b == 0) {
  15. return 1;
  16. }
  17. for(int i = 0; i < b; i++) {
  18. temp = temp * a;
  19. }
  20. return temp;
  21. }
  22. }