Skip to document

Untitled document - Vishveshvarayya technological University - CSE

Vishveshvarayya technological University - CSE
Course

Software Engineering (CS530)

376 Documents
Students shared 376 documents in this course
Academic year: 2020/2021
Uploaded by:

Comments

Please sign in or register to post comments.

Preview text

import java.*;

class Account{ String custName; int accNo; double balance; String type_of_acccout;

Scanner i = new Scanner(System);

public void withdraw(double amount) { if(balance > amount) balance -= amount; else System.out("Account has 0 or insufficient balance");

}

public void deposit(double amount) { balance += amount; System.out(amount+"/- Rupees deposited successfully"); }

public void updateBal() { System.out("Updated Balace is : "+balance); }

public void balance() { System.out("The Total Bank Balance is : "+ balance +"/-"); }

}

class CurrAcc extends Account{ int chequeBook; int minBal = 100;

Random rand = new Random();

public void issueCheque() {

System.out("The issued Cheque book no is :"+ (int)(Math()*100000000)); }

public void imposePenalty(int penalty) { balance -= penalty; }

public void checkBal() { if(balance >= minBal) System.out("The Balance is : "+balance);

else { System.out("The balance is less than minimum. The penalty of Rs.78/- will be deducted"); imposePenalty(78); System.out("The Balance is : "+balance); }

}

}

class Savings extends Account{ double interest;

public void checkBal() { System.out("The Balance is : "+balance); }

public void compoudInterest() { int r, t, n;

System.out("Enter the interest rate:"); r = i();

System.out("Enter the period:"); t = i();

System.out("Enter no of times:"); n = i();

acc(deposit); break;

case 2: System.out("Enter the amount to be withdrawn:"); double withdraw = input(); acc(withdraw); break;

case 3 : acc(); break;

case 4: acc(); acc(); break;

case 5: return; } } }

else { CurrAcc curr = new CurrAcc();

System.out("Enter the customer name: "); curr = input();

System.out("Enter the account no: "); curr = input();

System.out("Enter the initial account balance: "); curr = input();

curr();

while(true) {

System.out("1\t2\t3 Balance\t4");

int choice = input();

switch(choice) {

case 1: System.out("Enter the amount to be deposited:"); double deposit = input(); curr(deposit); break;

case 2: System.out("Enter the amount to be withdrawn:"); double withdraw = input(); curr(withdraw); break;

case 3 : curr(); break;

case 4: return; } }

}

}

}

Was this document helpful?

Untitled document - Vishveshvarayya technological University - CSE

Course: Software Engineering (CS530)

376 Documents
Students shared 376 documents in this course
Was this document helpful?
import java.util.*;
class Account{
String custName;
int accNo;
double balance;
String type_of_acccout;
Scanner i = new Scanner(System.in);
public void withdraw(double amount)
{
if(balance > amount)
balance -= amount;
else
System.out.println("Account has 0 or insufficient balance");
}
public void deposit(double amount)
{
balance += amount;
System.out.println(amount+"/- Rupees deposited successfully");
}
public void updateBal()
{
System.out.println("Updated Balace is : "+balance);
}
public void balance()
{
System.out.println("The Total Bank Balance is : "+ balance +"/-");
}
}
class CurrAcc extends Account{
int chequeBook;
int minBal = 100;
Random rand = new Random();
public void issueCheque()
{