Can somebody solve this problem.

Problem:
Write a program that reads a set of 10 integers, and then finds and prints the sum of the even and odd integers.

I have no idea, what kind of Documentation or Library to use on this problem. I'm a beginner and I need help with this urgently.

**I only need the C++ program + the flowchart of this problem**
Yes I can solve that problem.


EDIT:

wiseass remarks aside, we're not going to do your homework for you. Show us what you've done, show us where you're having trouble, and we can help you figure out how to solve the problem.

But posting a homework problem and saying "help me" is a great way to get ignored.
Last edited on
Jezz, I was wondering if people can solve the problem. I din't want to somebody make the program for me. Please, don't get all angry at me.

Btw, I'm going to do the program right now, When I having a problem I will just post; What is the issue and etc.
you wrote:
I din't want to somebody make the program for me.


you wrote:
**I only need the C++ program + the flowchart of this problem**


I suppose technically you didn't ask for the program, you just said you needed it.

Although technically I also answered your question:

me wrote:
Yes I can solve that problem.


;P

Sorry if I seem short. We get tons of people who pop in here to try and get instant homework solutions. It gets tiring after a while and it's easy for one's patience to be worn thin.
Hahahaha. Sorry, Yeah You technically thought I said I ask the program. But, I definitely said I needed it. Because, is the only exercise I need help, I'm new at "C++" and that's why need help with it, so I can see how to do it.
I was up all night trying to know how to do it, but I got no idea what kind of library, function,etc. to use. :(
*It's only that exercise that I need help, I had 10 exercise to do, but this one; I'm scrashing my head on how to do it.*
The easiest part is getting input. Start with that. Then seperate the even and odd numbers and calculate the sum. Give it your best attempt and post something when you need help.

Edit: I guess you're probably supposed to start with the flowchart, so you should do that first.
Last edited on
The program is a Arrays, or any kind of Loops?! Please, Let me know.
Hey, Guys this is the program I did by now, Program runs, but I don't know it doesn't stop after I write 10 integers.
Btw, the "Problem" is a I/O Files Program?! If it yes, please let me know.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <iostream>
#include <cmath>
using namespace std;


int _tmain(int argc, _TCHAR* argv[])
{
	int num=0, even=10, odd=0, notInteger=0;
	int stop ;
	do
	{
	cout << "Enter the list of 10 integers that you want to get added followed by '#' sign " << endl;
	cin >> num;
	stop = num;
	}while ( (char) stop  != '#' ) ;
	for ( int num = 0 ; num < stop ; ++ num )
	{
		if (num % 2 == 0)
		{
	}
		else if(num % 2 == 1)
		odd = odd + num;
		{
	notInteger = 1;
		cout << "Please enter only integers" << endl;
		cin >> num; 
	stop = num;
	break ;
	}

	}

	//if(notInteger == 1)
	if(notInteger == 0)
	{
		cout << "The sum of the even integers is: " << even << endl;
		cout << "The sum of the odd integers is: " << odd << endl;
	}
		system("pause");
		return 0;
}  



Enter the list of 10 integers that you want to get added followed by '#' sign
2
Enter the list of 10 integers that you want to get added followed by '#' sign
4
Enter the list of 10 integers that you want to get added followed by '#' sign
6
Enter the list of 10 integers that you want to get added followed by '#' sign
8
Enter the list of 10 integers that you want to get added followed by '#' sign
8
Enter the list of 10 integers that you want to get added followed by '#' sign
10
Enter the list of 10 integers that you want to get added followed by '#' sign
12 
Enter the list of 10 integers that you want to get added followed by '#' sign
14
Enter the list of 10 integers that you want to get added followed by '#' sign
16
Enter the list of 10 integers that you want to get added followed by '#' sign
18
Enter the list of 10 integers that you want to get added followed by '#' sign
20
*************Enter the list of 10 integers that you want to get added followed by '#' sign
22************* :'(
Topic archived. No new replies allowed.