Click here to Skip to main content
14,599,199 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hello.
i am in need of to calculate following program kindly help me to do.
my project is:
for ex,
april month deposit - 300 (int 9%)
interest            -  2.25
may month deposit     - 300
existing amount(apr)  - 300
total                 - 600 (9%)
interest              - 4.5
sum of int (2.25+4.5) should display in text box. friends i should calculate intrest like this for 12 months.

how to calculate cumulative interest and the sum of interest should display textbox in c#.net back end is oracle
Thank you in advance..

i have completed up to calculate interest. i dunno how to calculate cumulative (ie) 2.25 + 4.5
my coding is:
           int cumu = Convert.ToInt32(textBox3.Text.Trim());
           int totdep = Convert.ToInt32(textBox4.Text.Trim());
           decimal tot = cumu + totdep;
           textBox4.Text = Convert.ToString(tot);
          
           decimal cumuint = ((tot * 10) / 100)/12;
           textBox5.Text = Convert.ToString(cumuint);
           int openbal = Convert.ToInt32(textBox2.Text.Trim());
           int totbal = cumu + openbal;
           textBox2.Text = Convert.ToString(totbal);

   actually received amount is textbox3. in textbox4 holds total received in that textbox4 calculating  interest. the interest amount will display in textbox5.
my needs are the sum of interest amount should calculate and display in textbox6

Old Balance	Current	Total	Per	month		
0	        300	300	9	2.25		
300      	300	600	9	4.5		
600	        300	900	9	6.75		
900	        300	1200	9	9		
1200     	300	1500	9	11.25		
1500	        300	1800	9	13.5		
1800	        300	2100	9	15.75		
2100	        300	2400	9	18		
2400	        300	2700	9	20.25		
2700	        300	3000	9	22.5		
3000     	300	3300	9	24.75		
3300	        300	3600	9	27		
				175.5	total int	I need to calculate this total


how can i develop the code for this calculation.?




[edit]Spurious Inline code removed, Code block added to preserve formatting - OriginalGriff[/edit]

[edit again]Code block added - use the widget above the text box to surround you code: it does all sorts of useful things! - OriginalGriff[/edit again]
Posted
Updated 1-Mar-11 18:32pm
v6
Comments
OriginalGriff 1-Mar-11 13:40pm
   
What have you tried? Anything?
   
Where is your effort?
--SA
laurancelove 1-Mar-11 14:25pm
   
okay friend. actually i received amount in textbox3. in textbox4 holds total received(apr+may) in that textbox4 calculating interest. the interest amount will display in textbox5.
my needs are, the sum of interest amount should calculate and display in textbox6
Yusuf 1-Mar-11 14:28pm
   
I am really sorry. My son who is 11 years old, just started learning small basic. In the book there was similar exercise. Just reading the book and asking some questions, he was able to figure it out. This is just basic stuff. I am not blaming you for not working it out, but for not showing any effort. Just dumping it here and asking for help is not the way to learn. Show what have you done so far.

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

OK, Rule 1: Use sensible names! "textbox1", "textbox2", "textbox3", etc. don't help anybody understand your program (and it looks unprofessional). Use names that describe what the user is supposed to put in them!

I've been trying to understand how your code relates to the numbers you provided the first time but it isn't easy:

In fact, I give up!
Tell us, what do your various textboxes hold, and what are you actually trying to achieve! I think it'll be quicker all round... :laugh:
   
Comments
Albin Abel 1-Mar-11 16:02pm
   
Also there are problems with basics. He got confused with data types.

int cumu = Convert.ToInt32(textBox3.Text.Trim());
int totdep = Convert.ToInt32(textBox4.Text.Trim());
decimal tot = cumu + totdep;
I am not sure why an int+int goes to decimal.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100