This preview shows page 1. Sign up to view the full content.
Unformatted text preview: li_umr;
Bo qirlpa(n ep Bo ssme)
The function should return t u of the squirrels are playing, otherwise it should return f l e
We are having a party with amounts of tea and candy.
Write a function named t a p r y hat has two parameters:
e _ a t t
n e_at(n e, n ad)
This function returns the outcome of the party encoded as an integer: 0 means bad, 1 means good, and
2 means great. A party is good (1) if both t a nd c n y re at least 5. However, if either t a r
a d a
c n y s at least double the amount of the other one, the party is great (2). However, in all cases, if
a d i
either t a r c n y s less than 5, the party is always bad (0).
e o a d i
Write a function named l n _ u that has three integer parameters:
itln_u(n a itb itc;
n oesmit , n , n )
This function returns the sum of parameters a b nd c However, if one of the parameters is equal to
. one or both of the other parameters, then the equal values are treated as 0 when the sum is calculated.
● l n _ u ( , 2 3 returns 2 (the two 3's are treated as 0);
oesm3 , )
● l n _ u ( , 3 3 returns 0 (the three 3's are treated as 0).
oesm3 , )
Write a function named c o e f r hat has three integer parameters:
l s _ a t
_olcoefrita itb itc;
Bo ls_a(n , n , n )
This function returns t u if one of b r c s "close" to a differing from a y at most 1) and the other
re o i ( b
is "far" from a differing from a nd the "close" parameter by 2 or more). ( a
Note: the C standard library has a function that r...
View Full Document
This lab report was uploaded on 03/28/2014 for the course SYSC 2006 taught by Professor Schram during the Spring '12 term at Carleton CA.
- Spring '12