C++ Only use #include #include #include using namespace std; 1. Write a function named "is
Posted: Tue Jul 12, 2022 8:22 am
C++ Only use #include <iostream>#include <string>#include <sstream>using namespace std;
1. Write a function named "isMaxTheLast" that accepts an arrayof integersand its size. The function will check the array to see whether thelast elementin the given array is largest in the list.If it is, it will return true. Otherwise, it will returnfalse.In addition, it also returns the number of elements in the arraythat has the same value with the last element.
Requirement: please use only pointer notation in the function.No array notation.
For example, the following arrays with expected returnvalues int numList0[] = {10} ; // return true and 1 int numList1[] = {10, 20, 30, 40} ; // returntrue and 1 int numList2[] = {40, 30, 20, 40} ; // returntrue and 2 int numList3[] = {40, 30, 40, 40} ; // returntrue and 3 int numList4[] = {40, 20, 30, 10} ; // returnfalse and 1 int numList5[] = {30, 40, 20, 30} ; // returnfalse and 1 int numList6[] = {50, 50, 60, 50} ; // returnfalse and 3
1. Write a function named "isMaxTheLast" that accepts an arrayof integersand its size. The function will check the array to see whether thelast elementin the given array is largest in the list.If it is, it will return true. Otherwise, it will returnfalse.In addition, it also returns the number of elements in the arraythat has the same value with the last element.
Requirement: please use only pointer notation in the function.No array notation.
For example, the following arrays with expected returnvalues int numList0[] = {10} ; // return true and 1 int numList1[] = {10, 20, 30, 40} ; // returntrue and 1 int numList2[] = {40, 30, 20, 40} ; // returntrue and 2 int numList3[] = {40, 30, 40, 40} ; // returntrue and 3 int numList4[] = {40, 20, 30, 10} ; // returnfalse and 1 int numList5[] = {30, 40, 20, 30} ; // returnfalse and 1 int numList6[] = {50, 50, 60, 50} ; // returnfalse and 3