Question: / * PROJECT 3 - Complex Formula Let's create a program with a few functions to satisfy a set formula with several components. Read the
PROJECT Complex Formula
Let's create a program with a few functions to satisfy a set formula with several components.
Read the code and all of its comments. Follow the instructions contained in the comments to complete this project.
Remember, do not delete or change anything already in this file.
When finished, compress this project into a ZIP folder and submit it to Canvas.
Create a program using functions that satisfies the following sets equation.
A x : x is prime or x is divisible by and x is a Fibonacci number and x
The main function is completed for you. Your job is to create the functions it calls.
Include the iostream, cmath, and vector libraries.
Create the following four functions.
isPrimeint input Returns true if input is prime, false if it is not.
To receive credit, you may use no other function besides sqrt here.
isXMultipleOfYint input, int divisor Returns true if input is divisible by divisor,
false if it is not.
inSequenceint input, int divisor Returns true if either of the two functions above would return
true, false if it would return false for both.
fibonacciint limit Returns a vector containing every Fibonacci number up to and including limit
To receive credit, the only functions you may use are vector functions and abs You must also
account for all possible integer inputs, including negatives and zero.
int main
fibonacciSeries holds the series of Fibonacci numbers up to
sequence will contain the contents of fibonacciSeries which are prime or multiples of
vector fibonacciSeries fibonacci;
vector sequence;
Populates sequence with the Fibonacci numbers that satisfy either of its conditions.
forauto it : fibonacciSeries
ifinSequenceit
sequence.pushbackit;
Prints sequence to the terminal, each value separated with a space.
forauto it : sequence
cout it ;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
