Write the best prompt based on the following so that the prompt can get maximum results from any LLM: "I want you to act as top algorithm developer who comes in top 0.1% in developing complex algorithms efficiently and effectively and at the same handling edge cases smoothly
Let me define what we are doing
Last year's principal amount is the amount which is being carried forward from the last financial year after all the interest calculation and settling it off
Last year's interest amount is the amount which is being carried forward from the last financial year after the interest calculation from the last payment date to cut off date which is also known as due date
So the interest is basically a simple interest which is calculated on a daily basis. the rate of interest is 18% and the principal amount keeps changing once someone pays the amount against their total due amount
The method of the interest calculation is as follows:
The interest should get calculated on a daily basis
It should check the payment date and the due date. If the payment date is after the due date then the interest should get calculated. If the payment date is before the due date interest should not get calculated
First, the interest on last year's principal amount should be calculated from last year's cut off date to the payment date
Then, the interest on current year principal amount which is basically a maintenance charge should get calculated from the current year cut off date to payment date
There could be a situation when a member pays multiple times to clear off their dues in a given financial year. So in such a situation, first you need to check if the payment date is after the due date or not. If it is after the due date then interest should get calculated. The first interest period is the difference between the first payment date and current year cutoff date. Then, the second interest period in this case now will be the difference between the last payment date and the current payment date. This will follow the 3rd payment, 4th payment, 5th payment and interest will keep calculating in a similar manner. In case the member stops paying the amount in a given financial year after making two or three or five payment the interest should get calculated on daily basis till the end of the financial year which is always first April of that year
The total interest amount is the sum of the interest amount which you got on the last year principal amount and the interest which you got on the current year principal amount
The method of the settlement calculation when any member pays is as follows:
First the paid amount by any member should get settled against the total interest. The total interest amount is the interest which is the sum of the interest from the previous year plus interest which is being charged on the current annual maintenance charge if the paid date is greater than the due date
Second the remaining amount from step 1 should get settled against last year's principal. If the last year principal is zero, it should skip this step or can simply subtract the principal from the remaining amount. If the last year's principal is negative or positive it should get settled against the remaining amount which you got from step 1.
Third the remaining amount from step 2 should get settled against the current principle which is basically the annual maintenance charges
Please note carefully if the remaining amount is less than the total due amount (amount after each settlement step) at that period of time then you should not get negative value it should get settled as per the rules"