Question
Can someone please help me solve these problems thank you soooo much
Instructions Work out the answers to these problems manually without the use of a computer. This will help you develop the ability to read and analyze code. It will also provide you with practice solving the type of problems that will appear on Quiz 3 and the final exam. During these exams, you will not have access to a computer to solve these problems, so you need to develop the ability to read code, analyze it and think critically about it. After coming up with answers manually, you can optionally write and run test code to check whether you have solved the problems correctly. Submit a single document with your answers either by email or through your remote Git repository. Figure 1 Write a predicate function that checks whether two vectors are identical (contain exactly the same elements in the same order). A declaration of the function is shown in Figure 1. The function returns true if the two vectors are identical; otherwise it returns false. Figure 2 Implement a function that determines if the unlucky number 13 appears in a vector. The function returns true if 13 appears in the vector at least once; otherwise it returns false. A declaration of the function is shown in Figure 2. Write test code that tests every statement in the isUnlucky function you implemented in the previous problem. Express your tests using assertions. Figure 3 Write a predicate function called isStrictlyIncreasing that checks whether a vector of integers contains values that are in strictly increasing order. A declaration of the function is shown in Figure 3. The function returns true if the elements are in strictly increasing order; otherwise it returns false. For example, it will return true for v = (-2, 4, 5, 6, 8) and it will return false for (3, 4, 6, 6, 9). Figure 4 Write a function named flatten that takes a 2-dimensional array of integers with 1 rows and 2 columns and returns a vector that contains all of the arrays elements. Copy the values a row at a time. In other words, first copy row into the vector, then row 1, then row 2. and so on. The declaration of flatten is given in Figure 4. Figure 5 Implement a function called findMax that determines the maximum value in a 2-dimensional array. A declaration of the function is shown in Figure 5. The variables ROWS and COLS are constants defined elsewhere in the program; you dont need to define them, just use them.
Explanation / Answer
1 #include <vector>