Q1. Write a program to compute the contribution of a school to a charity fund if
one branch has contributed Rs.35500 every year to it for last 12 years and
another branch of the school has contributed Rs. 18500 for last 8 years.



Answer :

Sure, let's break down the problem step-by-step to find the solution.

1. Identify the contributions from each branch:
- The first branch contributes Rs. 35,500 per year.
- The second branch contributes Rs. 18,500 per year.

2. Identify the time duration for each contribution:
- The first branch has been contributing for 12 years.
- The second branch has been contributing for 8 years.

3. Calculate the total contribution from each branch:
- For the first branch:
[tex]\( \text{Total contribution from the first branch} = \text{Contribution per year} \times \text{Number of years} \)[/tex]
[tex]\[ \text{Total contribution from the first branch} = 35,500 \times 12 \][/tex]

- For the second branch:
[tex]\( \text{Total contribution from the second branch} = \text{Contribution per year} \times \text{Number of years} \)[/tex]
[tex]\[ \text{Total contribution from the second branch} = 18,500 \times 8 \][/tex]

4. Sum the total contributions from both branches to get the overall contribution:
[tex]\[ \text{Total contribution} = \text{Total contribution from the first branch} + \text{Total contribution from the second branch} \][/tex]

Let's perform the calculations:

- First branch total contribution:
[tex]\[ 35,500 \times 12 = 426,000 \][/tex]

- Second branch total contribution:
[tex]\[ 18,500 \times 8 = 148,000 \][/tex]

- Overall total contribution:
[tex]\[ 426,000 + 148,000 = 574,000 \][/tex]

So, after performing the computations step-by-step, we find that the school has contributed a total of Rs. 574,000 to the charity fund.