You could probably get away with a while statement:

double d = 0;

while (d < 4.33)

{

}

Bob

double d = 0;

while (d < 4.33)

{

}

Bob

Solved

Posted on 2007-08-02

I think I just need someone smarter or more experienced to help me see how to solve this. Sometimes I wonder if I have the "mental" prowess to be a software developer...LOL. I feel like a dummy sometimes. Maybe talking this out will help me find the answer. Discussion is always a good idea for these matters. :)

I have an enumeration I am using to determine amortization periods, as follows:

public class CommonFinancedItems

{

private AmortizationPeriodType _amortType;

public CommonFinancedItems()

{

}

#region enums

public enum AmortizationPeriodType : int

{

Weekly = 52,

BiWeekly = 24,

Monthly = 12

}

public AmortizationPeriodType AmortPeriod

{

get

{

return _amortType;

}

set

{

_amortType = value;

}

}

#endregion

}

elsewhere in my program my intent is to use these enumerations to determine HOW OFTEN a payment is to be made. I have two objects, one is for Mortgage (M) and one is for Heloc (H) -- Heloc represents "Home Equity Line of Credit". Basically....it boils down to 2 seperate interest-bearing loans that need to be paid-off. The trick is...the H is used to pay down large chunks of the principle on the M. The idea is...you can pay down a mortgage faster if you are applying payments, big payments, to the principal every so often. Make sense?

Okay....so now my "problem" is ... while only ONE payment is being made on the Mortgage every month, there are going to be either 1, 2 or 4.33 (repeating decimal) H payments for EACH Mortgage payment. This does not seem to lend itself to a for loop very nicely. I could just truncate the Weekly payments to just 4 but that seems wrong...

Is my question making sense?

Say it was Weekly payments (52 divided by 12 is 4.33 repeating)

for(i=0;i < 4.33;I++) { } can't do that

I have an enumeration I am using to determine amortization periods, as follows:

public class CommonFinancedItems

{

private AmortizationPeriodType _amortType;

public CommonFinancedItems()

{

}

#region enums

public enum AmortizationPeriodType : int

{

Weekly = 52,

BiWeekly = 24,

Monthly = 12

}

public AmortizationPeriodType AmortPeriod

{

get

{

return _amortType;

}

set

{

_amortType = value;

}

}

#endregion

}

elsewhere in my program my intent is to use these enumerations to determine HOW OFTEN a payment is to be made. I have two objects, one is for Mortgage (M) and one is for Heloc (H) -- Heloc represents "Home Equity Line of Credit". Basically....it boils down to 2 seperate interest-bearing loans that need to be paid-off. The trick is...the H is used to pay down large chunks of the principle on the M. The idea is...you can pay down a mortgage faster if you are applying payments, big payments, to the principal every so often. Make sense?

Okay....so now my "problem" is ... while only ONE payment is being made on the Mortgage every month, there are going to be either 1, 2 or 4.33 (repeating decimal) H payments for EACH Mortgage payment. This does not seem to lend itself to a for loop very nicely. I could just truncate the Weekly payments to just 4 but that seems wrong...

Is my question making sense?

Say it was Weekly payments (52 divided by 12 is 4.33 repeating)

for(i=0;i < 4.33;I++) { } can't do that

4 Comments

Title | # Comments | Views | Activity |
---|---|---|---|

jquery, aspx | 10 | 34 | |

How to Serailize Object to Array Json C# | 7 | 38 | |

Obtaining values from inside a HTMLDocument | 3 | 32 | |

sort multidimensional array in c# | 2 | 31 |

Join the community of 500,000 technology professionals and ask your questions.

Connect with top rated Experts

**24** Experts available now in Live!