Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#ffcccc
if (age >= 18) {
  takevote(personID); /* Take action */
}
...
if (age <= 18) {
   checkSchoolEnrollment(personID);/* Take a different action */
}

Compliant Solution

Code Block
bgColor#ccccff
enum { ADULT_AGE=18 };
...
if (age >= ADULT_AGE) {
  takevote(personID);
}
...
if (age <= ADULT_AGE) {
  checkSchoolEnrollment(personID);
}

...