C++ practice/exercise

I am reading the tutorials to learn C++, but I need to practice otherwise I'm not going to remember what I'm learning. Does anyone know a way for me to do some exercises or a project in which I could be involved ?? I have got a compiler (code block).

Thanks.
Try some of these exercises: http://www.cplusplus.com/forum/articles/12974/
And mess a bit with the code example you find in the tutorials, that helps a lot
Last edited on
Thank you very much, that should help me a lot.
In the first exercise, it mentions switch statements, I don't know how it is possible to use switch statement to resolve this particular exercise. I used only "if statement" :

if ((score<=100)&&(score>=90))
cout<<"Level A"<<endl;
else if ((score<=89)&&(score>=80))
cout<<"Level B"<<endl;
else if ((score<=79)&&(score>=70))
cout<<"Level C"<<endl;
else if ((score<=69)&&(score>=60))
cout<<"Level D"<<endl;
else if ((score<=59)&&(score>=0))
cout<<"Level F"<<endl;


??
Something like:
1
2
3
4
5
6
switch ( score )
{
     case 100: case 99: case 90: case 89: //...
          cout << "Level A";
     // etc.
}
The 'if' is better for this...
That's what I thought. Thank for your help.
'switch' only supported by integer.
So? what do you think 'score' is, a potato bag?
Anyway, with C++0x switch should work with any type
Anyway, with C++0x switch should work with any type


Ooh cool!
Topic archived. No new replies allowed.