Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function cigar_party($number_of_cigars, $is_weekend = false){
- if($is_weekend){
- if($number_of_cigars <= 39){
- return FALSE;
- }
- else{
- return TRUE;
- }
- }
- else{
- if(($number_of_cigars <= 39) || ($number_of_cigars >= 61)){
- return FALSE;
- }
- else{
- return TRUE;
- }
- }
- }
- cigar_party(30, false); // Should return boolean false.
- cigar_party(50, false); // Should return boolean true.
- cigar_party(70, true); // Should return boolean true.
- ?>
Add Comment
Please, Sign In to add comment