Kat H.

asked • 07/06/21

C++. Define a function ParseStr() that takes a string parameter and returns "Good" if the character at index 3 in the string parameter is a space. Otherwise, the function returns "Bad".

C++. Define a function ParseStr() that takes a string parameter and returns "Good" if the character at index 3 in the string parameter is a space. Otherwise, the function returns "Bad".

Ex: ParseStr("cheetah") returns

Bad

Recall string's at() returns a character at the specified position in the string. Ex: myString.at(3)


Code:


#include <iostream>

#include <string>

#include <cctype>

using namespace std;


/* Your code goes here */


int main() {

string input;

string output;


getline(cin, input);

output = ParseStr(input);

cout << output << endl;


return 0;

}

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.