Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * @param <type> $NewEmployee Object
- * @return ınt
- * Please review the following function and create a NewEmployee Class with the desired attributes filled with suitable values (boolen or integer 1-10 , only experienceyears is an exception) to gain the maximum points
- * from the CalculateNewEmployeePoints and send the proper code to us with your CV.
- */
- function CalculateNewEmployeePoints($NewEmployee) {
- $totalPoints = 0;
- foreach($NewEmployee as $key => $value) {
- switch ($key) {
- case "graduatedengineering":
- if($value===true)
- $totalPoints+=10;
- break;
- case "teamplayer":
- if($value===true)
- $totalPoints+=10;
- break;
- case "abilitytosolvelastminuteproblems":
- if($value===true)
- $totalPoints+=10;
- break;
- case "militaryobligation":
- if($value===false)
- $totalPoints+=10;
- break;
- case "workedinsimilarprojects":
- if($value===true)
- $totalPoints+=5;
- break;
- case "industryaware":
- if($value===true)
- $totalPoints+=5;
- break;
- case "keenonmobileapps":
- if($value===true)
- $totalPoints+=5;
- break;
- case "experienceyears":
- if(is_int($value))
- $totalPoints+=($value*5);
- break;
- default:
- /** Other characteristics,
- * "phpknowledge"
- * "sqlknowledge"
- * "linuxknowledge"
- * "xhmtlknowledge"
- * "cssknowldge"
- * "jqueryknowledge"
- * "englishknowledge"
- * "creativity"
- * "seoknowledge"
- */
- if($value>10) $value=10;
- $totalPoints+=$value;
- break;
- }
- }
- return $totalPoints;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement