Question: Given string userString on one line and integer strIndex on a second line, output Found match if the character at index strIndex of userString is

 Given string userString on one line and integer strIndex on a

Given string userString on one line and integer strIndex on a second line, output "Found match" if the character at index strIndex of userString is 'i'. Otherwise, output "No match". End with a newline. Ex: If the input is: guitar 2 then the output is: Found match Note: Assume the length of string userString is greater than strIndex. \begin{tabular}{r|r} 1 & \#include iostream> \\ 2 & \#include string> \\ 3 & using namespace std; \\ 4 & \\ 5 & int main() \{ \\ 6 & string userstring; \\ 7 & int strIndex; \\ 8 & \\ 9 & getline(cin, userstring); \\ 10 & cin >> strIndex; \\ 11 & \\ 12 & Your code goes here */ \\ 13 & \\ 14 & return ; \\ 15 & \end{tabular}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!