Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
public class Bankkonto {/* Dieses Programm bildet die Funktionen eines Geldautomaten ab*/
public static void main(String[] args) {
int kontostand = 300000000;
int kreditlimit = -200; /* Betrag, um den das Konto maximal berzogen werden kann */
int auszahlung = 200000000; /* Hier wird eigegeben, wieviel vom Konto abgehoben werden soll*/
int kontostandNeu = kontostand - auszahlung;
if (kontostand - auszahlung >= kreditlimit) {
System.out.println("Es werden " + auszahlung + " Euro ausbezahlt.");
System.out.println("Ihr aktueller Kontostand betraegt " + kontostandNeu + " Euro");
}
else {System.out.print ("Der Vorgang kann nicht ausgefuehrt werden. Ihr Guthaben reicht leider nicht aus.");}
}
}
Advertisements
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.
AcceptLearn more