We know that Joylin was given a box of comic books before hand, though the amount is never explicitly told to us. However, we know x is the amount of months the subscriptions have been going. 6 is what I presume to be the amount of comic books from the subscriptions.
40 represents the amount of comic books given in the box.
It is 340 dollars in total, I do this in an ubcenventional way of dividing 272 by 80 which gave you 3.4 which is equal to one percent and then multiply that by 20 which is 68 and add that to the other 80 percent of her bill to get 340 dollars