Does each case in a switch statement terminate with a break


1. Variables

• Do variables have meaningful names?
• Are hard-coded numbers used instead of named constants?
• Is a variable value read only? If so is it declared const or final?
• Are all variables used?

2. Functions
• Do functions have meaningful names?
• Are all parameters used?

3. Correctness
• Are all parenthesis properly matched?
• Are brackets properly matched?
• Does each case in a switch statement terminate with a break? Is there a default case?

4. Initialization
• Are variables initialized before their first use?

5. Loops
• Do all loops successfully terminate?
• If used, do break and continue statements work correctly?
• Does the body of the loop modify the loop variables?

6. Dynamic Allocation
• Is every dynamically allocated piece of memory properly de-allocated?

7. Pointers
• Can a NULL pointer be de-referenced?

8. Comments
• Is the code properly commented?
• Do the comments accurately describe the corresponding code?

9. Defensive Programming
• Are checks made to prevent errors such as divide by zero or illegal data?

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Does each case in a switch statement terminate with a break
Reference No:- TGS0666970

Now Priced at $40 (50% Discount)

Recommended (98%)

Rated (4.3/5)