Monday, May 24, 2010

C++ Programming Problem - where do I start?

I have a program I have to write that calculates genotypes AA, AB, %26amp; BB in proportions x, y %26amp; z, for a number of generations that is an input to the program. I have a "function"for P, and then equations for succeeding proportions (x, y %26amp; z), and my problem is this. I know what I have to do, mathematically to get the final result. What I am not sure of where to start is the programming of the function within the program.





Does anyone have any ideas given my desciption? I do not want someone to tell me how to do it all - I just need a nudge in the right direction (IE the first step!).





Let me know if you need more information.





Many thanks in advance!

C++ Programming Problem - where do I start?
Consider this:





What are your inputs? The number of generations? Proportion/probability factors? What exactly are they?


What are your outputs? Proportions for the dominant and recessive genotypes? What else?





So now, you need to have a function that returns the outputs (appropriate return type), while taking in the inputs (arguments).





If you understand the algorithms needed to get the output from the input, then you know what to code inside the function.


No comments:

Post a Comment