Link to home
Start Free TrialLog in
Avatar of ITsolutionWizard
ITsolutionWizardFlag for United States of America

asked on

logic in c#

I have a small website that I try to get life insurance premium based on the primary, spouse, and total kids - see attached.
Just assume you want to buy life insurance and you are trying to generate a quote with premium.

My question is: How can I get the possible combination along primary, spouse, and total kids in c#. I try to come up with example
family of 4 primary/spouse & 2 kids. However, the kids may be up to 10 as max. so the combination will be huge if I codes it one by one.

See any experts can help me.
Life1.xlsx
Avatar of zephyr_hex (Megan)
zephyr_hex (Megan)
Flag of United States of America image

Can you post the formula here so those of use blocked from downloading attachments can see what you're talking about?
Avatar of ITsolutionWizard

ASKER

Applicant(s)             Premium       Life
Primary Only             $100.00       x
Spouse Only             $120.00       x
Primary & Spouse              $80.00       x
Kid 1 Only               $10.00       x
Kid 2 Only             $10.00       x
Kid 1 & Kid 2 Only             $10.00       x
Primary & Kids 1 Only             $75.00       x
Primary & Kid 2 Only             $75.00       x
Primary & Kid 1 & Kid 2 Only             $75.00       x
Spouse & Kids 1 Only             $75.00       x
Spouse & Kid 2 Only             $75.00       x
Spouse & Kid 1 & Kid 2 Only             $75.00       x
Primary & Spouse with Kid 1 Only             $75.00       x
Primary & Spouse with kid 2 Only             $75.00       x
Family (All members)             $280.00       x
ASKER CERTIFIED SOLUTION
Avatar of zephyr_hex (Megan)
zephyr_hex (Megan)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kaufmed
How do you present these options to the user?
any way you want to present is fine
I still need to know how Applicant is stored.  What does your code look like that tells you the applicant is "Primary & Kid 1", for example?
i just need to get the codes giving me the possible combinations. don't worry about where it is going to store.
I don't think you're understanding my question.  How do you know what kind of applicant you have?  Does the user click some check boxes on a form, or what?  And if so, what does that code look like?

You must have some method for determining what type of applicant you have.
You can assume it is just web form
Yes. I have primary key and I think your question helps me to move forward for the logic. thanks