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

Question) Using Splashkit, C++ and visual studio code (NOT Iostream) Fix the Cod

ID: 3753794 • Letter: Q

Question

Question)

Using Splashkit, C++ and visual studio code (NOT Iostream)

Fix the Code?

Create an index-of function which will return the index of a given name in the array. This should return -1 if the name is not present. int index_of (string value, string datal, int size) Hint: Use similar logic to was found. contains from the video, but return the index where the name oCreate a print_summary procedure that accepts the array and its size, then prints out all of the names, the total length of these names, the index of your name (or -1 if your name is not in the array), and the shortest name. void print_summary(string datall, int size) o Have main create and work with an array of string:s .Use a constant for the size (make it 5) Loop to read in the names Call print summary to output the details

Explanation / Answer

The header file not included here... even though based on my knowledge errors raised cause of

1) SIZE property not declared, you can define SIZE as #define SIZE 5 or const int SIZE = 5

2) line no: 25, Invalid condition it must be for(int i=0; i<SIZE; i++){

int index_of(string value, string data[], int size){

for(int i=0; i<size; i++){

if(data[i]==value)

return i;

}

return -1;

}

void print_summary(string data[], int size){

for(int i=0; i<size; i++){

write(data[i]);

}

}

Let me know if you have any clarifications, Thank you...

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote