|
|
@ -3,22 +3,22 @@ package programmiermethoden_und_Werkzeuge; |
|
|
|
import java.util.Scanner; |
|
|
|
|
|
|
|
public class Taschenrechner { |
|
|
|
int addition(int a, int b) { |
|
|
|
static int addition(int a, int b) { |
|
|
|
|
|
|
|
return a + b; |
|
|
|
} |
|
|
|
|
|
|
|
int multiplikation(int a, int b) { |
|
|
|
static int multiplikation(int a, int b) { |
|
|
|
|
|
|
|
return a * b; |
|
|
|
} |
|
|
|
|
|
|
|
int division(int a, int b) { |
|
|
|
static int division(int a, int b) { |
|
|
|
|
|
|
|
return a / b; |
|
|
|
} |
|
|
|
|
|
|
|
int potenzieren(int a, int b) { |
|
|
|
static int potenzieren(int a, int b) { |
|
|
|
|
|
|
|
int temp = 1; |
|
|
|
|
|
|
@ -33,20 +33,20 @@ public class Taschenrechner { |
|
|
|
return temp; |
|
|
|
} |
|
|
|
|
|
|
|
boolean kleinerAls(int a, int b) { |
|
|
|
static boolean kleinerAls(int a, int b) { |
|
|
|
|
|
|
|
return a < b; |
|
|
|
} |
|
|
|
|
|
|
|
boolean groeßerAls(int a, int b) { |
|
|
|
static boolean groeßerAls(int a, int b) { |
|
|
|
return a > b; |
|
|
|
} |
|
|
|
|
|
|
|
boolean gleich(int a, int b) { |
|
|
|
static boolean gleich(int a, int b) { |
|
|
|
return a == b; |
|
|
|
} |
|
|
|
|
|
|
|
int randomNummer(int a, int b) { |
|
|
|
static int randomNummer(int a, int b) { |
|
|
|
//Zufällige Nummer von a bis b |
|
|
|
int temp = 0; |
|
|
|
|
|
|
@ -55,7 +55,7 @@ public class Taschenrechner { |
|
|
|
return temp; |
|
|
|
} |
|
|
|
|
|
|
|
double pie() { |
|
|
|
static double pie() { |
|
|
|
return Math.PI; |
|
|
|
} |
|
|
|
|
|
|
@ -68,7 +68,7 @@ public class Taschenrechner { |
|
|
|
return intScan; |
|
|
|
} |
|
|
|
|
|
|
|
void startTaschenrechner() { |
|
|
|
static void startTaschenrechner() { |
|
|
|
//Funktion zum Starten des Taschenrechnerprogramms |
|
|
|
System.out.println("1.Addition, 2.Multiplikation, 3.Division, 4.Potenzieren, 5.kleinerAls, 6.groeßerAls, 7.Gleichgroß, 8.Zufällige Zahl, 9.PI"); |
|
|
|
Scanner scan = new Scanner(System.in); |
|
|
|