definition and declaration of variable overallResult with ternary statement