VB icon

Addition of Five Numbers Using Class in C+

Email
Submitted on: 8/31/2015 4:13:15 AM
By: Jake R. Pomperada  
Level: Beginner
User Rating: Unrated
Compatibility: C++ (general)
Views: 2675
author picture
 
     In this article I would like to share with you how to declare and use a class in C++. This program I called addition of three numbers using a class in C++. It will ask the user to enter five numbers and then it will compute and display the total sum of the three numbers. 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: Addition of Five Numbers Using Class in C+
// Description:In this article I would like to share with you how to declare and use a class in C++. This program I called addition of three numbers using a class in C++. It will ask the user to enter five numbers and then it will compute and display the total sum of the three numbers.
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 <iostream>
 using namespace std;
 class add {
 public:
 int a,b,c,d,e;
 int solve(int a,int b,int c, int d, int e)
 {
 return(a+b+c+d+e);
 }
 };
 main() {
 add values;
 cout << "\n\t Addition of Numbers ";
 cout << "\n\n";
 cout << "Enter five numbers : ";
 cin >> values.a >> values.b
 >> values.c >> values.d
 >> values.e;
 cout << "\n\n";
 cout << "The total sum "
 << values.solve(values.a,values.b,
values.c,values.d,
values.e) << ".";
 cout << "\n\n";
 system("pause");
 }


Other 69 submission(s) by this author

 


Report Bad Submission
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:

Your Vote

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 ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.