forked from ChicoState/cpp-gtest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrando.cpp
42 lines (38 loc) · 917 Bytes
/
rando.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "rando.h"
//#include <stdlib.h>
/**
* Worry if only one child is smiling or if all children are smiling
**/
bool Rando::shouldWorry(bool childASmile, bool childBSmile, bool childCSmile)
{
if( childASmile && childBSmile && childCSmile )
return true;
else if( childASmile ^ childBSmile ^ childCSmile )
return true;
else
return false;
}
/**
* Determines if first or second are evenly divisible by the other.
**/
bool Rando::isDivisbleBy(int first, int second)
{
return false;
}
/**
* Given a number, num, says whether or not that number is prime
* (that is, only evenly divisible by itself and 1. For the sake
* of this function, do NOT consider 0 prime)
**/
bool Rando::isPrime(int num)
{
return true;
}
/**
* Given two numbers, first and second, return the value of the one
* that is closest to zero without actually being zero.
**/
int Rando::nearestToZero(int a, int b)
{
return 0;
}