mmesarina,
On both problems you have to find integers for x and y.
Let's look at the pencil problem:
21x * 23y = 130
If you try with integers values for x and y you will see that the only combination that works is x = 4 and y = 2
Now, let's look at the donut problem:
0.40x + 0.30y = 6
If you try different integers for x and y you will see that more than one combination works:
x = 3 ; y = 16
x = 6 ; y = 12
....
Thus, the difference between the two problems (and that's what makes one solvable and the other not) is that in one case you can find a unique solution and in the other not...