---
oh wait I think i'm being slow again due to lack of sleep >_< hahaha that just means the setprecision(2); right?
>> that just means the setprecision(2); right?
I guess... there's no such thing as set(w). There's setw, but that's not appropriate for this task. setprecision is the right way to go.
>> my teacher always declares everything 1st and then does everything else hehe.
Many people still do that, it's just not the best practice. In this case following your teacher's style for your assignment is best practice, especially if you aren't going into programming.
Thank you
Last edited by lifeis2evil; 10-25-2007 at 04:21 PM.
Isn't that two different things?
About your indentation: the general idea is to make suer you have those brackets where you can easily see them so you see where something begins and ends. It's up to everyone what style you want to use, but you could back on my example how I've done it if you want.
I always put a bracket right after an IF or a loop or something, then I intent every line of code inside that block and put the end bracket on the same level as the loop or IF or whatever:
It's not a good thing to put these wherever because it's hard to see where the block ends. Consider the following:Code:for(;;) { ... }
Much harder to read, valid but still harder to read. Something to think about.Code:for(;;) { ... }
>> have at least one assignment statement) did I do that?
An assignment statement is where you assign a value to a variable. Any time you have something = something else, that is assignment.
>> Whats the iostream for ?
It is a header which has the code for cout and cin.
thank you
Last edited by lifeis2evil; 10-25-2007 at 07:26 PM.
Yes, addBefore the return statement, just like you've done at the end of your program.Code:getch();