1. ## Need some answers to these super short problems

Hey folks,
Got an exam tomorrow and need these done in C++ in a short time. They're very easy exercises and I'm just too busy with my websites and other projects . I'd be glad to reward the one who'll finish these for me with a domain (www.thetechtalks.com)...

I need those finished in 2 hours:

http://i49.tinypic.com/259lkdy.jpg

Thanks

2. Welcome to the board. Please read our homework policy. In other words, write some code and post whatever questions you have here, if you get stuck.

Cheers.

3. What a load of rubbish - pathetic excuse.

4. Even for a beginner, this is only a couple of hours work I would imagine! It's pretty much all the same code. You'd better get some caffeine in!

5. Originally Posted by Sebastiani
Welcome to the board. Please read our homework policy. In other words, write some code and post whatever questions you have here, if you get stuck.

Cheers.
Im offering a domain in exchange for this...

Im just too busy with other stuffs folks. Would appriciate some help

6. Perhaps something like this would be more appropriate, then? Point is, this just isn't the forum for such a thing. Good luck.

7. Someone should just write the ugliest code they can imagine, that still fulfill those extremely simple criteria.

8. Ok Ive started to do those on my own...

I dont understand the second one at all: Write a program to calculate the sum of N numbers.

Can anybody explain what does that mean?

9. Originally Posted by dnilra
Ok Ive started to do those on my own...

I dont understand the second one at all: Write a program to calculate the sum of N numbers.

Can anybody explain what does that mean?
'N numbers' means any given number.

Therefore, in rough pseudo-code, I assume it is asking if the user chose number 10, the SUM of N numbers would be 1+2+3+4+5+6+7+8+9+10. You just need to write a simple loop to do this.

10. Here's the first one. I'll be expecting my domain in two hours.

Code:
```#include <iostream>

using
namespace
std

;

int

main
(

){int

x                           =
0

,

n

=

51
;

for             (

int

i                                               =

0
/*Carefully note this section*/
; i                <
n               ;                  ++
i

)                                {

cout                         <<

i

<<                   endl             ;
}

return 0;
}```

11. Originally Posted by darren78
'N numbers' means any given number.

Therefore, in rough pseudo-code, I assume it is asking if the user chose number 10, the SUM of N numbers would be 1+2+3+4+5+6+7+8+9+10. You just need to write a simple loop to do this.
I think that's it, thanks.
Originally Posted by C_Sparky
Here's the first one. I'll be expecting my domain in two hours.

Code:
```#include <iostream>

using
namespace
std

;

int

main
(

){int

x                           =
0

,

n

=

51
;

for             (

int

i                                               =

0
/*Carefully note this section*/
; i                <
n               ;                  ++
i

)                                {

cout                         <<

i

<<                   endl             ;
}

return 0;
}```
Dude, The domain will be for who'll make all not just the first one. I made that in like 10 secs

12. 'N numbers' means any given number. Therefore, you will need to prompt the user to select a number to use and store in a variable.

Therefore, in rough pseudo-code, if the user chose number 10, the SUM of 1 to N numbers would be 1+2+3+4+5+6+7+8+9+10. You just need to write a simple loop to do this.
Alternately, you can use Gauss's equation: ( N * ( N + 1 ) ) / 2.

13. Originally Posted by Sebastiani
Alternately, you can use Gauss's equation: ( N * ( N + 1 ) ) / 2.
Looking at his assignment he is required to use loops, but yes Gauss's equation would be simpler!

14. Originally Posted by C_Sparky
Here's the first one. I'll be expecting my domain in two hours.
<snip>
Just FYI, gratuitous space != obfuscation.

15. Originally Posted by darren78
Looking at his assignment he is required to use loops, but yes Gauss's equation would be simpler!
Ah, right - the looping requirement. Overlooked that.