CPP1
CPP1
Create a class Distance, which accepts data in feet and inches adds two distances and displays the members of the distance object in the appropriate form. Test the class in the main program by creating object d1 and d2 of type distance, accept data for each object and add them then display them.
2.
Define a class to represent Bank account. Include the following members. Data members (1) Name of depositor (2) Account number (3) Type of account (4) Balance member functions (a) To assign initial values (b) To deposit an amount in a particular account (c) To withdraw an amount after checking the balance (d) To display name and balance Write a main program to test the class for handling 10 customers. Write a program to implement the push and pop functions of a stack using a class Stack. Also make use of a private member function display() to display contents of the stack after every push and pop operations. Create a member function init() to initialize top of the stack. Demonstrate the use of static variables and static function in a class by using it to count the number of objects created in the program, having a static function to display the count.
3.
4.
5.