Info10Repository/Methoden.java

84 lines
1.5 KiB
Java

public class Methoden
{
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 void term(){
System.out.println(summe(produkt(3, 2), produkt(3, 5)));
}
public static double potenz(int i, int j){
double L = 1;
for(int t = 0; t < j; t++){
L = L * i;
}
return L;
}
public static double max( double a, double b)
{
if(a > b){
return a;
}
else{
return b;
}
}
public static double min( double a, double b)
{
if(a < b){
return a;
}
else{
return b;
}
}
public static double abs( double a)
{
if(a < 0){
return a*-1;
}
else{
return a;
}
}
public static boolean istGroß( double a)
{
if(a>1000){
return true;
}
else{
return false;
}
}
public static boolean istBetragmäßigGroß( double a){
return istGroß(abs(a));
}
}