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.
**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.
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.
#include <iostream>
#include <cmath>
usingnamespace 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)
{
}
elseif(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************* :'(