Limit the invalid output to only 1 time if the percent is greater than 100
Right, you said that before. Think about it logically, how the two parts are separate, one running one after the other. And then remove something to make it print what you want.