Declare a Boolean variable and set it to false. Test the variable before you print and print only if it is false. When you print set the variable to true.
Declare a Boolean variable and set it to false. Test the variable before you print and print only if it is false. When you print set the variable to true.