homework or class assignment ?? These are vague and general questions that can be answered in a number of ways. These can be based on what type of system, programming language to name a few variables. If you have some real world issue you would like solved we need more specific details please.