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.
Math, but sounds like a computer forum question ...
I think that's a bit outside the scope of a simple OpenStudy question ;)
hehehhehe...just asked..yup its a com sci problem...no ones replying in there..=)
=(
Math group is best!
Post it in Computer Science and I will do it later when I get off from work.
Do you need the source code too? Or do you have some of the Code??
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.
I can translate it if you want...=)thanks doodletech..i posted it there..
fewscrewsmissing....i find it hard because they required us to use switch statements.
Something like... for( i=(n-1);i>=1;i-- ) { value = n/i; if( round(value,0) == value ) { /* add to your collection of factorials /* } }
(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.)
ceil() rounds up and floor() rounds down
IPO? What's an IPO?
Input Processing Output. Conceptual model of how the program operates.
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
Join our real-time social learning platform and learn together with your friends!