Then you need to ask for an age, and check the age that was given.
Then you need to ask for an age, and check the age that was given.
Yes, I did. That's my first part.
That's right before the counter part. Dosen't give me an error.Code:cout << "\nHow old are you ?: "; cin >> age; if ( age > 17) cout << " You can vote. \n" ; else cout << " You can not vote. \n" ;
So make up your mind what you want to do:
1) Ask one person their age and determine voting status.
2) Print I love computers 5 times.
3) Other (please specify): ____________________________
This is all included in the output part. I need to include both.
output
if age greater than 17
display "You can vote."
else
display "You can't vote."
endif
counter is assigned 0
while counter is less than 5
display "\nI love computers!"
increment counter
endwhile
So the first bit gets an age (presumably) and checks whether the person is of voting age. The second bit prints "I love computers" five times.
Do you think that these bits are related in any way? If so, go to Student Health and have them adjust your medication level.
If you want to do something other than print "I love computers" five times after asking someone their age, then you need to state, as clearly as you can, what it is that you are trying to do.
Honestly, I do not know myself. That's all I have in terms of instructions. I think if the value is less than 5 it's supposed to print I love computers. I guess like a joke... someone who is younger than 5 can probably not use the computer.
So , I get the age first. Tell the user if he can or can't vote. In case he's younger than 5 it's supposed to say I love computers.
And I'll just ignore the insult.
Last edited by XodoX; 03-08-2009 at 10:43 PM.
There's a difference between printing "I love computers" five times and printing I love computers one time, if the age is less than five. Your pseudocode is for the first.
If you don't know what your assignment is, then I don't know how much more anyone (including you) can do about it.
all right. Just nevermind then.