Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

#include <iostream> #include <cstdlib> using namespace std; /* Prints the given

ID: 3542846 • Letter: #

Question



#include <iostream>
#include <cstdlib>

using namespace std;

/* Prints the given integer array to the screen.
*
* Require: size >= 0 &&
* size == array[last+1];
* Ensure: Only array memory location are traversed &&
* output format: "{ x,y,z }"
*/
void stringifyArray(int array[], int size);

int main() {
int integers_one[3] = { 0,1,3 };
int integers_two[2][3] = {{ 0,1,2 },{2,3,4}};

cout << "Integer array: " << endl;
stringifyArray(integers_one, 3);

exit(EXIT_SUCCESS);
}

Lines are not to excede 80 characters in length. Do not use cryptic names for variables, functions, etc. Do not use do-while loops (unless told otherwise). Do not use breaks (unless told otherwise). Do not use continues (unless told otherwise). Do not use switch-cases (unless told otherwise). Array Traversal, Printing do not edit or alter the main() code block in any way, shape, or form., you are to implement the function. If you don't implement, in this case, stringifyArray(int[],int) then your submission is wrong. Implement the stringifyArray(int[],int) used in the code below.

Explanation / Answer

please rate - thanks

any questions - ask



#include <iostream>
#include <cstdlib>

using namespace std;
#define length(a) ( sizeof ( a ) / sizeof ( *a ) )
/* Prints the given integer array to the screen.
*
* Require: size >= 0 &&
* size == array[last+1];
* Ensure: Only array memory location are traversed &&
* output format: "{ x,y,z }"
*/
void stringifyArray(int array[], int size);

int main() {
int integers_one[3] = { 0,1,3 };
int integers_two[2][3] = {{ 0,1,2 },{2,3,4}};

cout << "Integer array: " << endl;
stringifyArray(integers_one, 3);
exit(EXIT_SUCCESS);
}
void stringifyArray(int array[], int size)
{int i;
cout<<"{";
for(i=0;i<size-1;i++)
     cout<<array[i]<<",";
cout<<array[i]<<"} ";
}