Let the number of apples be represented by x

Let the amount he has be represented by y

Apples are 30 cents so he has spent .3x dollars on apples (I'm assuming 100 cents in a dollar, I'm not American)

He has 3 dollars left over so

y = 0.3x + 3

Pears are 40 cents so he has spent .4x dollars on pears

He need 1 more dollar

y + 1 = .4x or y = 0.4x - 1

So have simultaneous equations

y = 0.3x + 3

y = 0.4x - 1

Can you solve it now?