Doesn't your textbook provide information about for-loops?
This problem is an obvious example of a homework assignment in an introductory programming course. It is elementary. If you, at the moment, cannot handle this problem by yourself, then go back to your books to learn how to do it. Don't expect to find a for-loop tutor around here. Don't expect to find someone to provide a solution for you to hand in as if it was your work.
You may present your own code, and ask "Why doesn't this work?", and someone may be as kind as to point out where you are wrong. Not by giving you the right answer, but by pointing at what you should check and fix up yourself.
When a communications packet is transmitted/received in the parent application, it queues it to the child application and then the child application decodes it and formats it into a user friendly format and displays it.