Question: SOLUTION IS REQUIRED USING THE CONCEPT OF OBJECT ORIENTED PROGRAMMING ( OOP ) IN C++ A program should consist of a class bankAccount and 4
SOLUTION IS REQUIRED USING THE CONCEPT OF OBJECT ORIENTED PROGRAMMING ( OOP )
IN C++
A program should consist of a class bankAccount and 4 instance variables: name, account_no, act_balance, amount_withdraw. name : Customer Name amount_no: Customer Account Number act_balance: Customer Balance amount_withdraw: amount that is to be withdrawn The class should further consist of get and set functions for each instance variable. The set function of act_balance consists of a try and a catch block, if the user enters the balance less than zero (means negative, which is not possible) then this function should throw an exception, and its corresponding catch block should handle this exception by providing another opportunity to the user to enter the balance again. Similarly, the setter of the amount_withdraw variable should also have a try and a catch block. If the user enters the withdraw amount greater than the current balance than this function should throw an exception, and its corresponding catch block should handle exception. Part b: What are the three basic principles of Object-Oriented Design (OOD)? Just briefly and very precisely tell about each principle. Is there any principal of OOD used in the above problem(class bankAccount part a)? Why or why not? Part c: Give an instance where the above class (bankAccount) can use one principle of OOD (you can make an inheritance hierarchy diagram to illustrate.) Write the hierarchy class definitions with data members and method interfaces only, without including method definitions and testing function (main). Hint: you can take think about real-life Banking system & bankaccounts system and implement ( Part c) to make your custom solution.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
