Assume that a bank maintains two kinds of accounts for customers, one called as savings account and the other as current account. The saving account provides compound interest (9%) and withdrawal facilities but not cheque book facility. The current account provides cheque book facility but no interest. Current account holders should also maintains a minimum balance of 500 and if the balance falls below this level, a service charge (Rs. 50) is imposed. Create a class Account as abstract that stores customer name, account number and opening balance (Rs. 500). From this derive the classes Current and Saving to make them more specific to their requirements. Include necessary member functions in order to achieve the following tasks:Get the account details using constructor.Display the account details using friend function.Deposit an amount (Rs. 10000) for a customer and update the balanceCompute and deposit interest. Now display the balance using inline function.Withdraw amount (Rs. 10200) for a customer after checking the balance and update the balance.Check for the minimum balance (for current account holders), impose penalty, if necessary, and update the balance.Count the number of transactions carried out using static member variable and display the count value by static member function OUTPUTAmount deposited successfullyCurrent Balance:10500Interest deposited successfullyCurrent Balance:10695Insufficient balance. Penalty of 50 imposedCustomer Name:JohnAccount Number:123456Current Balance:10695Customer Name:JaneAccount Number:654321Current Balance:450Total number of transactions:3
Question
Assume that a bank maintains two kinds of accounts for customers, one called as savings account and the other as current account. The saving account provides compound interest (9%) and withdrawal facilities but not cheque book facility. The current account provides cheque book facility but no interest. Current account holders should also maintains a minimum balance of 500 and if the balance falls below this level, a service charge (Rs. 50) is imposed. Create a class Account as abstract that stores customer name, account number and opening balance (Rs. 500). From this derive the classes Current and Saving to make them more specific to their requirements. Include necessary member functions in order to achieve the following tasks:Get the account details using constructor.Display the account details using friend function.Deposit an amount (Rs. 10000) for a customer and update the balanceCompute and deposit interest. Now display the balance using inline function.Withdraw amount (Rs. 10200) for a customer after checking the balance and update the balance.Check for the minimum balance (for current account holders), impose penalty, if necessary, and update the balance.Count the number of transactions carried out using static member variable and display the count value by static member function OUTPUTAmount deposited successfullyCurrent Balance:10500Interest deposited successfullyCurrent Balance:10695Insufficient balance. Penalty of 50 imposedCustomer Name:JohnAccount Number:123456Current Balance:10695Customer Name:JaneAccount Number:654321Current Balance:450Total number of transactions:3
Solution 1
This seems like a programming problem, specifically in an object-oriented programming language like C++ or Java. Here's a simplified version of how you might structure this in pseudo-code:
abstract class Account {
String customerName;
int accountNumber;
int balance;
constructor(String name, int number) {
this.customerName = name;
this.accountNumber = number;
this.balance = 500;
}
void deposit(int amount) {
this.balance += amount;
}
void displayDetails() {
print(this.customerName);
print(this.accountNumber);
print(this.balance);
}
}
class Current extends Account {
int minimumBalance = 500;
int serviceCharge = 50;
void checkBalance() {
if (this.balance < this.minimumBalance) {
this.balance -= this.serviceCharge;
}
}
}
class Saving extends Account {
float interestRate = 0.09;
void addInterest() {
this.balance += this.balance * this.interestRate;
}
void withdraw(int amount) {
if (this.balance >= amount) {
this.balance -= amount;
} else {
print("Insufficient balance.");
}
}
}
This is a simplified version and doesn't include everything from your problem statement, like the static transaction counter or the friend function for displaying account details, but it should give you a good starting point.
Solution 2
This seems like a programming problem, specifically in an object-oriented programming language like C++ or Java. Here's a simplified version of how you might structure this in pseudo-code:
abstract class Account {
String customerName;
int accountNumber;
int balance;
constructor(String name, int number) {
this.customerName = name;
this.accountNumber = number;
this.balance = 500;
}
void deposit(int amount) {
this.balance += amount;
}
void displayDetails() {
print(this.customerName);
print(this.accountNumber);
print(this.balance);
}
}
class Savings extends Account {
void computeAndDepositInterest() {
this.balance += this.balance * 0.09;
}
void withdraw(int amount) {
if (this.balance >= amount) {
this.balance -= amount;
} else {
print("Insufficient balance.");
}
}
}
class Current extends Account {
void checkMinimumBalance() {
if (this.balance < 500) {
this.balance -= 50;
print("Insufficient balance. Penalty of 50 imposed");
}
}
void withdraw(int amount) {
if (this.balance >= amount) {
this.balance -= amount;
} else {
print("Insufficient balance.");
}
}
}
This is a simplified version and doesn't include everything from your problem statement, like the static member for counting transactions, but it should give you a good starting point.
Solution 3
This seems like a programming problem, specifically in an object-oriented programming language like C++ or Java. Here's a simplified version of how you might structure this in pseudo-code:
abstract class Account {
String customerName;
int accountNumber;
int balance;
constructor(String name, int number) {
this.customerName = name;
this.accountNumber = number;
this.balance = 500;
}
void deposit(int amount) {
this.balance += amount;
}
void displayDetails() {
print(this.customerName);
print(this.accountNumber);
print(this.balance);
}
}
class Savings extends Account {
void computeAndDepositInterest() {
this.balance += this.balance * 0.09;
}
void withdraw(int amount) {
if (this.balance >= amount) {
this.balance -= amount;
} else {
print("Insufficient balance.");
}
}
}
class Current extends Account {
void checkMinimumBalance() {
if (this.balance < 500) {
this.balance -= 50;
print("Insufficient balance. Penalty of 50 imposed");
}
}
void withdraw(int amount) {
if (this.balance >= amount) {
this.balance -= amount;
} else {
print("Insufficient balance.");
this.checkMinimumBalance();
}
}
}
This is a simplified version and doesn't include everything (like the static transaction count), but it should give you a good starting point. You'll need to adjust this to fit the specific syntax and capabilities of whatever programming language you're using.
Similar Questions
Assume that a bank maintains two kinds of account for its customers, one called savings account and the other current account. The savings account provides compound interest and withdrawal facilities but no cheque book facility. The current account provides cheque book facility but no interest. Current account holders should also maintain a minimum balance and if the balance falls below this level, a service charge is imposed.Create a class Account that stores customer name, account number and type of account. From this derive the classes Curr-acct and Sav-acct to make them more specific to their requirements. Include the necessary methods in order to achieve the following tasks:Accept deposit from a customer and update the balance.Display the balance.Compute and deposit interest.Permit withdrawal and update the balance.Check for the minimum balance, impose penalty, if necessary, and update the balance.Write a java program to create a bank account with Name of the account holder, type of account(savings or current), Account number and Balance amount in the . Also, create 5 customers for the class Bank_account using array of objects. Access the customers to perform credit, debit and display of balance.Input 1:Enter the customers:ReenaSavings1231000RobinCurrent4562000PraveenSavings7893000SherinCurrent2342500DeenaSavings5672000
Create a SavingsAccount class that behaves just like a BankAccount using inheritanceCreate a SavingsAccount class that behaves just like a BankAccount, but also has an interest rate and a method that increases the balance by the appropriate amount of interest (Hint:use Inheritance).Note: Refer to the displayed test cases for better understanding.Sample Test CasesTest Case 1:Expected Output:account·number:784569874account·holder·name:Raviinitial·balance:50000interest·rate:2Savings·Account·Created:Account·Number:784569874Account·Holder:RaviBalance:50000.0Interest·Rate:2.0%After·adding·interest:Balance:·51000.0Test Case 2:Expected Output:account·number:547981235account·holder·name:Ramanainitial·balance:90000interest·rate:2.5Savings·Account·Created:Account·Number:547981235Account·Holder:RamanaBalance:90000.0Interest·Rate:2.5%After·adding·interest:Balance:·92250.0
Write a java program to create a bank account with Name of the account holder, type of account(savings or current), Account number and Balance amount in the account. Also, create 5 customers for the class Bank_account using array of objects. Access the customers to perform credit, debit and display of balance. Input 1: Enter the customers: Reena Savings 123 1000 Robin Current 456 2000 Praveen Savings 789 3000 Sherin Current 234 2500 Deena Savings 567 2000 Enter choice: 1. Credit 2. Debit
DescriptionA bank has decided to renew its policy; according to the new policy, you can only own a savings account with minimum savings of Rs.1000. Construct a class ‘SavingAmount’ with only one integer instance variable ‘saving’. The class will have the following methods in it: A setter method 'setInitialSaving' that will take an integer as a parameter and set the value of savings equal to that of the integer .A getter method 'getCurrentSaving' that will return the saving .An increment method that will increase the savings by Rs.1000 .A decrement method that will decrease the savings by Rs.100 .A method to check the savings of a person say 'checkSaving'. If the savings amount is greater than or equal to Rs.1000, print “Congratulations! You have saved a good amount”. If the amount is less than Rs.1000 and greater than or equal to 0, print “Insufficient saving!”. If the savings amount is less than 0, print “You are in debt”.Input: Your program should take the integer amount.Output: The output should be in the following format.Call the 'decrementSaving' method once.Call the incrementSaving' method once.Call the 'checkSaving' method.Display the total savings.Sample Input:20000 Sample Output:Congratulations! You have saved a good amountYour current savings are Rs 20900Sample Input:-1000 Sample Output:You are in debtYour current savings are Rs 100Sample Input:-100 Sample Output:Insufficient saving!Your current savings are Rs 800
Program that creates a class Account that stores a variable balance. The class has methods to startaccount, to deposit money, to withdraw money and tell the current balance amoun
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.