I am working on ps2a and can't figure out how to make a loop to generate all the possible 6a+9b+10c combinations.
Do you have anything coded at all? Post it (using codepad, ideone or the like), no matter how ugly. It's easier to look at your specific problem rather than to speak generally. If you're stuck, start small. Write a code for one combination that you know will work. Build from there.
Hi Bobby: Try to use the solve1 function from lecture 4 (at minute 28) as a model. The two problems are very similar.
You will need 3 nested loops. One for each of a, b, and c.
try doing this
@Muavia, Yes, that is a solution to the problem. But he needs to learn how to write a program. That's why the other responses gave him hints and not just the answer.
Thank you for all the help. I will work on this tonight. and hopefully post what i get.
Join our real-time social learning platform and learn together with your friends!