Thursday, February 21, 2013

OOCP (CPP) : Example # 07 : Convert Rupees into Paisa using C++

OOCP (CPP)  :  Example # 07 : Convert Rupees into Paisa  using C++

* Lets start learning CPP (C++) Using Example.

* Convert Rupees into Paisa using c++

//Written by Latest Technology Guide    
//Title : OOCP (CPP)  :  Example # 
07 : Convert Rupees into Paisa  using C++


#include <iostream.h>
#include <iomanip.h>
#include <conio.h>

class Money
{
private:
int rupees,paisa;
public:
void getdata(int,int);
void sum(Money,Money);
inline void putdata();
};
//=================================================
// GetData member function
//=================================================
void Money :: getdata(int r, int p)
{
rupees = r;
paisa = p;
}
//=================================================
//  Sum member function
//=================================================
void Money :: sum(Money m1, Money m2)
{
paisa = m1.paisa + m2.paisa;
rupees = paisa / 100;
paisa = paisa % 100;
rupees = rupees + m1.rupees + m2.rupees;
}
//=================================================
//  Putdata member function
//=================================================
void inline Money :: putdata()
{
cout << "Rupees : " << rupees << setw(10) << "Paisa  : " << paisa << endl;
}
//=================================================
// Main Function
//=================================================
void main()
{
clrscr();
Money m1,m2,m3;
m1.getdata(5,84);
m2.getdata(8,38);
m3.sum(m1,m2);

cout << "m1 amount is  ";
m1.putdata();

cout << "m2 amount is  ";
m2.putdata();

cout << "m3 amount is  ";
m3.putdata();

getch();
}

Output:

* you will find output as : conversion from rupees into paisa.

--------------------------------------------------------------------------------
OOCP (CPP)  :  Example # 07 : Convert Rupees into Paisa  using C++.

* Example shows how to convert rupees into paisa


Note: All programs are developed and tested using Turbo C++ 3.0 under Windows XP. We just want to provide guidelines to the users. If you are using any other Compiler or other operating system they you need to modify this program as per your requirements. 

2 comments:

  1. My name is Timothy Rister. I am an artist and I often use webcam, I have created an article on that subject. So, if you are interested for that subject then click here and read my article.Logitech C920 Webcam not Working 2021 .

    ReplyDelete
  2. Your article has greatly impressed me. I have read it in its entirety and highly respect it. This is one of the most useful blogs I have encountered. Looking forward to reading more posts from you. This is a profile that you should read to learn more about Auto Mouse Clicker. Please refer to the profile auto clicker.

    ReplyDelete