Step 1: Define variables.
Let $a$ = number of apples,\ $o$ = number of oranges (so $a+o=40$).
Let $x$ = price of one apple (in rupees), $y$ = price of one orange (in rupees).
Step 2: Form two cost equations.
Given purchase: $ax + oy = 17$.
After swapping quantities: $ox + ay = 15$.
Step 3: Add the two equations to isolate $x+y$.
\[
(ax+oy) + (ox+ay) = (a+o)(x+y) = 17+15 = 32.
\]
Since $a+o=40$, we get
\[
40(x+y)=32 ⇒ x+y=\frac{32}{40}=0.8\ \text{rupees} = 80\ \text{paise}.
\]
\[
\boxed{80\ \text{paise}}
\]