Write Java applications. First, define an account class that describes the bank accounts , including the member changes
Amount "Account" and "Deposit balance", the Member method has "deposit", "withdrawal" and "balance inquiry". Secondly
Write a main class that tests the function of the account class in the main class.
String zhanghao;double YuE; Blank (String zhanghao,double YuE) {this. Zhanghao=zhanghao;this. Yue=yue;} Double Cunkuan (double Qianshu) {if (qianshu<0) {System.out.println ("Please enter the correct amount");} Else{system.out.println ("Saved" +qianshu); Yue+=qianshu;} return YuE;} Double Qukuan (double Qianshu) {if (Qianshu>0&&qianshu<yue) {System.out.println ("take" +qianshu); Yue-=qianshu;} Else{system.out.println ("Incorrect Money");} return YuE;} public static void Main (string[] args) {blank as=new blank ("123456789", 500.0); System.out.println ("Balance is" +as.cunkuan (-100)); System.out.println ("Balance is" +as.qukuan (10000));}
Run results
A bank deposit and withdrawal of Java object-oriented exercises