Created
March 20, 2016 16:19
-
-
Save Fundibalus/a893a564d5f5fede5268 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package og11bank; | |
import java.util.Scanner; | |
public class OG11Bank { | |
public static void main(String[] args) { | |
System.out.println("Wie viel möchten Sie abheben?"); | |
Scanner scan1 = new Scanner(System.in); | |
double wv = scan1.nextDouble(); | |
double kontostandnachher; | |
kontostandnachher = Abheben(wv); //Aufruf der Methode Abheben() und der Wert "wv" wird übergeben. | |
} | |
class Bank { | |
public Konto testKonto; | |
} | |
class Konto { | |
private double kontostand = 50; | |
public double Abheben(double wv1, double kontostand1) { | |
int konto = 1; | |
int endstand; | |
wv1 = 1; | |
int counter; | |
while (counter < 2) { | |
if (konto - wv1 < 0) { | |
counter++; | |
return 0; | |
} | |
if (konto - wv1 > 0) { | |
(konto - wv1) = endstand; | |
return endstand; | |
} | |
} | |
while (counter > 2) { | |
return -1; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment