C++ Program to Find Interest
Constructor can be defined as the member function, which has the same name of the class. the object created by the constructor is destroyed with the help of destructor.
This is a program to find the interest using constructor.
Float principle, time, rate, interest;
Interest (float, float, float);
Void display ();
Interest:: interest ()
Principle = 0;
Interest:: Interests (float p, float t, float r)
Void interest:: display ()
Interest = (principle * time * rate) /100;
Void main ()
Float p, t, r;
Cout<<”\n enter the principle, time, rate”;
Interest obj (p, t, r);
- C++ Program Using Constructor and Destructor This is an object oriented programming in c++ to create...
- C++ Program to Find Sum and Average Using Class Class is the expanded concept of data structure, instead of...
- C++ Program Using Friend Function Friend function is used to access private, public and protected...
- C++ Program Using getdata() and display() The program uses member function getdata() and display() in-order to...
- C++ Program showing assignment operator overloading The symbol ‘=’ is used as Assignment operators. It is...