Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Function Returning Object:
This program is like to the previous program except the function returns object. The
main rule to be remembered is the function returning object must be defined as friend function in the class.
class interest
{float i,p,n,r,a;
public:
void getdata(int gp, int gn, int gr);
void putdata(void)
{cout<<"Interest is "<
cout<<"Amount is "< } Friend interest suminterest(interest,interest); }; void interest::getdata(int gp,int gn, int gr) {p=gp;n=gn;r=gr; cout<<"Enter Principal: "<<"\n"; cin>>p; cout<<"Enter Year: "<<"\n"; cin>>n; cout<<"Enter Rate: "<<"\n"; cin>>r; i=(p*n*r)/100; a=p+i; } interest suminterest(interest i1, interest i2) {interest i3; i3.i=i1.i+i2.i; i3.a=i1.a+i2.a; return i3; } int main() {clrscr(); interest i1,i2,i3; i1.getdata( 1000,10,2); i1.putdata(); i2.getdata(10000,8,3); i2.putdata(); i3 = suminterest(i1,i2); i3.putdata(); return 0; }
}
Friend interest suminterest(interest,interest);
};
void interest::getdata(int gp,int gn, int gr)
{p=gp;n=gn;r=gr;
cout<<"Enter Principal: "<<"\n";
cin>>p;
cout<<"Enter Year: "<<"\n";
cin>>n;
cout<<"Enter Rate: "<<"\n";
cin>>r; i=(p*n*r)/100; a=p+i;
interest suminterest(interest i1, interest i2)
{interest i3; i3.i=i1.i+i2.i; i3.a=i1.a+i2.a; return i3;
int main()
{clrscr();
interest i1,i2,i3; i1.getdata( 1000,10,2); i1.putdata(); i2.getdata(10000,8,3); i2.putdata();
i3 = suminterest(i1,i2);
i3.putdata();
return 0;
Question: a) Give two uses of NFS. b) Give one advantage of using NFS. c) Explain the following lines as they would be interpreted in the /etc/exports file i. /usr/local
Multiple Inheritance Multiple inheritance , as the name suggests , is deriving a class from more than one class . The derived class inherits all the properties of all its base c
limitation of linear array
Employ operator () instead of operator[]. While you have multiple subscripts, the cleanest way to do it is along with operator () instead of with operator[]. The reason is that
For this program you will add and test 2 new member functions to the IntSLList class posted on the website. The two member functions are: insertByPosn(int el, int pos) Assuming t
Problem : Compiler Design - Limit the methods Rahul is a newbie to the programming and while learning the programming language he came to know the following rules: ·
Project Description: I have software written with VB that i helped design, but now the original author died,(Neil Tromp), and the software ended up in the hands of someone else!
THIS PROGRAM IS TO ADD TWO DISTANCES & SHOW THEIR SUM AS NEW DISTANCE # include # include typedef int dist; struct distance { dist inch; dist feet; }; distance add
Control structures The control structures appear in both structured programming languages as well as object oriented programming languages. The three constructs used are: i)
steric in square
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd