Ask your own question, for FREE!
Mathematics 10 Online
OpenStudy (anonymous):

Create an IPO, flowchart and C++ source code for a program that would display all the factoral pairs of a specific number n. Example: n = 36 The factoral pairs are: 1 & 36 2 & 18 3 & 12 4 & 9 6 & 6.

OpenStudy (anonymous):

Math, but sounds like a computer forum question ...

OpenStudy (anonymous):

I think that's a bit outside the scope of a simple OpenStudy question ;)

OpenStudy (anonymous):

hehehhehe...just asked..yup its a com sci problem...no ones replying in there..=)

OpenStudy (anonymous):

=(

OpenStudy (anonymous):

Math group is best!

OpenStudy (anonymous):

Post it in Computer Science and I will do it later when I get off from work.

OpenStudy (anonymous):

Do you need the source code too? Or do you have some of the Code??

OpenStudy (anonymous):

I haven't coded in C++ for a long time. But it's easy enough to break down the factorials for any given number; a simple programmatic solution would be divide by all (n-1) to 1, and discard any values that aren't whole numbers. So if the rounded value is different to the calculated value, discard it.

OpenStudy (anonymous):

I can translate it if you want...=)thanks doodletech..i posted it there..

OpenStudy (anonymous):

fewscrewsmissing....i find it hard because they required us to use switch statements.

OpenStudy (anonymous):

Something like... for( i=(n-1);i>=1;i-- ) { value = n/i; if( round(value,0) == value ) { /* add to your collection of factorials /* } }

OpenStudy (anonymous):

(As I said, C++ is very rusty; I can't remember how to round values, but there should be a math.io file or something with such functions.)

OpenStudy (anonymous):

ceil() rounds up and floor() rounds down

OpenStudy (anonymous):

IPO? What's an IPO?

OpenStudy (anonymous):

Input Processing Output. Conceptual model of how the program operates.

OpenStudy (anonymous):

http://ideone.com/IT5kx a little better Oh so that's what those simple charts I keep seeing in CS classes are generally called :-P

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!