Math Stuff
EE 312
Due: Thursday 3/14/19 at 10:00 PM

50 points

No mistake. This is the same program that I give the intro students... I guess the only difference is that you have to implement all the functions without using any loops. You may use "helper" functions if you need any...but still no loops.

You will be implementing the following functions. You may modify the main to test the functions, but this program will work as a starting point.

//********** Function Prototypes ******************

//function isPrime
//input parameter - positive integer
//returns true if the number is prime, otherwise false
//

bool isPrime (int number);

 

//function printPrimes
//input parameter - positive integer
//Uses the isPrime method to print a list of prime numbers from 1 to n (inclusive).

void printPrimes (int n);


//function findFibo
//input parameter - positive integer
//returns the nth fibonacci number where
//Fib(0) -> 0
//Fib(1) -> 1
//Fib(N) -> Fib(N-2) + Fib(N-1)

int findFibo (int n);


//function findFactors
//input parameter - positive integer
//prints the prime factors of the given number to standard output (cout)
//example output: 52=2*2*13 (or 52=1*2*2*13) or 13=prime

void findFactors (int number);

----------------------------------------

NOTES: 

Turn in: One zipped file that includes: readme.txt (gives instructions for compiling and running code) and your source program. The makefile should create a executable program named "math_stuff". To make this process work better, zip the files on kamek before you transfer them back to your computer for turnin.

Upload: Turn in one zipped file named prog04math_xxxxx.zip where xxxxxx is your UT EID to Canvas.

Be sure to follow the style standards for the course. 

 

rlp 2/25/19