1. >> I agree, this is a new stragety for homework.

Anyone else remember the people posting their homework questions in the Contests Board? It's so genius that if I were a mod I'd've overlooked it

2. Hi Guys,

You have made me very disappointed. i was not here for my homework, just here to help someone. i have made many efforts in writing that code, but failed, you can see my attempts ... i again said Not everyone here for home work, there may be some other purpose...

Code:
```#include <iostream.h>
void main(){
char value;
int c,num,sum;
int total,aces,done;
cout << "How many cards do you have? (2-5)";
cin >>total;

c=1;
sum=0;
aces=0;
while (c<=total){
cout<<"Input value of card #"<<c<<" (2-9 or j,q,k,a)";
cin>>value;
if (value=='2'){
num=2;
}
elseif (value=='3'){
num=3;
}
elseif (value=='4'){
num=4;
}
elseif (value=='5'){
num=5;
}
elseif (value=='6'){
num=6;
}
elseif (value=='7'){
num=7;
}
elseif (value=='8'){
num=8;
}
elseif (value=='9'){
num=9;
}
elseif (value=='t'){
num=10;
}
elseif (value=='j' || value=='q' || value=='k'){
num=10;
}
elseif (value=='a'){
num=11;
aces++;
}

sum=sum+num;
c++;
}

if (sum>21){
if (aces>0){
c=0;
done=0;
while (done!=1){
sum=sum-10;
aces=aces-1;
if (aces==0 || sum<=21){
done=1;
}
}
}
}

If (sum>21){
cout << "Busted";
}
else{
cout <<sum;
}

}```

3. i was not here for my homework, just here to help someone.
i.e., here to help someone else get his/her homework done? Either way the homework policy applies, and you have pretty much attempted to mislead the community here by making it seem like a friendly "challenge" (which should be in the contests forum anyway, as noted by twomers ).

4. now can you help me, what i have done wrong in that program ??

5. now can you help me, what i have done wrong in that program ??
I shall be nice this time round:

2. You used void main() instead of the standard int main().
3. You used If instead of if (C++ is case sensitive for keywords).

You could simplify the handling of your card input by checking for ranges, but that should affect whether the code compiles or not. Note that I have not checked your logic.

6. That long if-elseif statement could be replaced with a switch statement, but that's just a suggestion. BTW, "elseif" is two words, "else if".

7. Also "elseif" should be two words, as in "else if"

8. Also "elseif" should be two words, as in "else if"
Oops, the dangers of alternating between C++ and PHP message boards

9. You'd also need an argument as to whether or not an ace is a '1' or an '11'. Something like;

Code:
```		else if (value=='a'){

if(sum>11)
{
num=1;
aces++;
}
else{
num=11;
aces++;
}

sum=sum+num;
c++;
}```

What are the Vegas odds he passed/failed the assigment?

11. Personally, it's not in my nature to be mean-spirited, but some of you Guys n' Dolls have been around a long time, so I imagine that wears on your patience. No doubt, you've seen it all. If the person posted the code first off though, he would have received plenty of help and his task would have been completed in no time.

I certainly understand members sayin', show you code, then we'll help.

12. Yup, that's the policy, even if it was homework if he posted a good effort and really tried, we could help him out, hell, half the stuff i've learned i've learned from here. No book in the world compares to this community. But when someone just posts something that is called a "Contest" without code then to us it sounds like "Homework"

Like i said, if he/she did it right the first time we never would've gotten into this =P

haha

13. @ Wraithan, that dictionary says it is Slang in all its usages and all of the sources are cited as being American, I count that as an American word not a proper English word.

14. The whole point of being set work is that they learn from attempting to do it (as opposed to passively just listening to or reading rules).

Kinda how most decent programmers learn

We had a guy at our place recently (now fired) who would say to me "what can I do at home to improve my ability?"

lol?

I told him to go home and write programs to do stuff.................

This guy had a 1st in CS.