I need help creating a beginning program

Oct 17, 2012 at 10:12pm
Hi I need to create a program that makes the user input numbers and the program then tells them if the number is even or odd. ill be back in an hour. get to work.
Oct 17, 2012 at 10:30pm
...Seriously?
Oct 17, 2012 at 10:47pm
Are you asking for our help, you asking for the answer? I can not speak for everyone, but I will not answer you with a complete program just because you need it.

I hope you didnt register for this site explicitly because you needed an answer.
Last edited on Oct 17, 2012 at 10:48pm
Oct 18, 2012 at 12:09am
Ok, I'm going to give you the benefit of the doubt and say you worded your question poorly.

Here is an unfinished version of your program.

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
#include <iostream>

using namespace std;

//Function to find out if a number is even or odd
void findNum(int input)
{
	
}

int main()
{
	//Input variable
	int input = 0;
	
	//Bool for the while loop
	bool go = true;

	//Beginning display message

	
	//While loop
	while(go)
	{
		findNum(input);
	}
	
	//Exit with zero
	return 0;
}


I want you to fill out the display message and even or odd function. Hint: use modulus.
Oct 22, 2012 at 11:44pm
Lol
Oct 23, 2012 at 1:37am
Go to google.
Oct 23, 2012 at 4:20am
An even function has reflectional symmetry about the y-axis, while an odd function has rotational symmetry about the origin. In other words, feven(x) = feven(-x), whereas fodd(x) = -fodd(-x). That should help you out.
Oct 29, 2012 at 4:04pm
he's not coming back because we didnt give him the answers to his homework. ;)
Oct 29, 2012 at 5:53pm
closed account (N36fSL3A)
gghf wrote:
get to work.


No, why don't you get to work on your homework.
Oct 29, 2012 at 6:11pm
I'd like to make it clear enough for you @gghf. A number is even if n modulus 2 equals 0. A number is odd if it isn't even. I hope you understood that, and with the code given above, you shouldn't have any problems.

Best of wishes,
~ Raul ~
Topic archived. No new replies allowed.