Advertisement
zerosensitivity

Grading application

Oct 4th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1.  
  2. public class BankAccount
  3. {
  4. private int accnum;
  5. private double balance;
  6. private String name;
  7. private String name1;
  8.  
  9. public BankAccount()
  10. {
  11.  
  12. balance = 50;
  13.  
  14. }
  15.  
  16. public void setname(String n){
  17.  
  18. name = n;
  19.  
  20. }
  21.  
  22. public void setAccNum(int a){
  23. accnum = a;
  24. }
  25.  
  26. public void makelodgement(double amount){
  27.  
  28. balance = balance + amount;
  29. }
  30.  
  31. public void makewithdrawal(double amount){
  32.  
  33. if (amount>balance){
  34. System.out.println("Insufficient Funds. Balance is" + balance);
  35. }
  36.  
  37. else{
  38.  
  39. balance = balance - amount;
  40. }
  41. }
  42.  
  43. public void checkbalance(){
  44. System.out.println("Balance is" + balance);
  45. }
  46.  
  47.  
  48.  
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement