We've built a tool in C# that asks the user a series of multiple choice questions and then based on their answers it displays a list of products.
We're not doing any complicated logic, we just have products associated with specific answers and if that answer is chosen, then that product is added to the list of results.
We're ending up with scenarios where we're getting all products or no products, so we need to take a look at a more thorough way of coding our logic.
To start, I'm building a utility app in C# to help us validate the tool. The first task I want the utility to perform is to return all possible combinations of answers. I'm getting stuck on this. This is one of those math problems that makes my head hurt. Here's what the questions look like:
- Question 1
- Answer 1
- Answer 2
- Question 2
- Answer 1
- Answer 2
- Answer 3
- Question 3
- Answer 1
- Answer 2
- Answer 3
- Question 4
- Answer 1
- Answer 2
Can some one get me started in right direction on how to accomplish returning a list of all possible combinations of answers via C#? Thanks.