58 lines
1.2 KiB
Java
58 lines
1.2 KiB
Java
|
|
|
|
public class Methoden
|
|
{
|
|
|
|
public static double quadrat(double x) {
|
|
double quadrat;
|
|
quadrat = x * x;
|
|
return quadrat;
|
|
}
|
|
|
|
public static void test()
|
|
{
|
|
System.out.println(quadrat(3));
|
|
}
|
|
|
|
public static int summe(int a, int b){
|
|
|
|
int summe = a + b;
|
|
return summe;
|
|
|
|
}
|
|
|
|
public static int differenz(int c, int d){
|
|
|
|
int differenz = c - d;
|
|
return differenz;
|
|
|
|
}
|
|
|
|
public static int produkt(int e, int f){
|
|
|
|
int produkt = e * f;
|
|
return produkt;
|
|
}
|
|
|
|
public static int quotient(int g, int h){
|
|
|
|
int quotient = g / h;
|
|
return quotient;
|
|
}
|
|
|
|
public static int term(int x){
|
|
|
|
System.out.println(summe(produkt(3, 2), produkt(3, 5)));
|
|
int ergebnis = quotient(summe(produkt(4, x), 8), differenz(summe(8, 9), produkt(3, 5)));
|
|
return ergebnis;
|
|
}
|
|
|
|
public static double potenz(double j, double k){
|
|
|
|
double E = 1;
|
|
for (int i = 0; i < k; i++){
|
|
E = E* j;
|
|
}
|
|
return E;
|
|
}
|
|
} |