#include using namespace std; int add_up(int *numbers, size_t length){ /* TODO: Finish this function */ } /* TODO: Add function swap, from task 2 */ /* TODO: Add function find_mam, from task 3 */ int main(){ /* * Calculate and print out the first 28 fibonacci numbers * Description of the fibonacci numbers: * https://en.wikipedia.org/wiki/Fibonacci_sequence * Note that some sources start the sequence at 1 instead of 0 */ int array[30] = {0, 1}; cout << "0 1 "; /* Take a few minutes to understand this next line. * It's all made of pieces you've seen already, so it should make sense after a while. */ for(int *ai = array + 2; ai < array + 30; cout << (*ai++ = *(ai - 1) + *(ai - 2)) << " "); cout << "\n"; // This is not in the loop, because of the semicolon on the line above // Task 1: Add up the last 10 numbers cout << add_up(/* TODO: Add parameters for this function call */) << endl; // Task 2: Write the function swap, so it swaps the values of a and b int a = 34, b = 299; swap(&a, &b); cout << "a = " << a << " b = " << b << endl; // Task 3: Figure out max, average, and minimum int max, average, minimum; find_mam(array, 30, &max, &average, &minimum); cout << "Max: " << max << endl; cout << "Average: " << average << endl; cout << "Min: " << minimum << endl; return 0; }