# Basic Math Operations Using Classes in C++

Email
 Submitted on: 8/31/2015 3:51:50 AM By: Jake R. Pomperada Level: Beginner User Rating: Unrated Compatibility: C++ (general) Views: 13675

In this article I would like to share with you a basic math operations using classes in C++. In basic mathematics there are four operations addition, subtraction, multiplication and division. In our example I am using classes, attributes and method to solve the problem. The code is very easy to understand and use a good way to learn object oriented programming using C++. If you have some questions about programming, about my work please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com. People here in the Philippines can contact me at my mobile number 09173084360. Thank you very much and Happy Programming.

code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 ``` //************************************** // Name: Basic Math Operations Using Classes in C++ // Description:In this article I would like to share with you a basic math operations using classes in C++. In basic mathematics there are four operations addition, subtraction, multiplication and division. In our example I am using classes, attributes and method to solve the problem. The code is very easy to understand and use a good way to learn object oriented programming using C++. If you have some questions about programming, about my work please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com. People here in the Philippines can contact me at my mobile number 09173084360. Thank you very much and Happy Programming. // By: Jake R. Pomperada //************************************** #include using namespace std; class math { private: int x,y; int sum,divide; public: int process_data(); int display(); }; int math :: process_data() { cout << "\n \t Basic Math Operations"; cout << "\n\n"; cout<<"Enter x value: "; cin>>x; cout<<"Enter y value: "; cin>>y; sum= x + y; divide = x - y; cout<<"\n sum= "<

Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)