Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Modify retrieve_form.cpp to transform the parse() and param() functions into objects in a class. The first video offers enough information to do the OOP modifications

Modify retrieve_form.cpp to transform the parse() and param() functions into objects in a class. The first video offers enough information to do the OOP modifications below.

and this is my retrieve_form.cpp :

#include #include #include #include #include using namespace std;

struct FIELDS { string name; string value; };

const int cnt = 4;

// Prototypes void parse(string, FIELDS []); string param(string, FIELDS [], int);

//main begins int main() { FIELDS name_value_pairs [cnt];

string qs(getenv("QUERY_STRING")); cout << "Content-type:text/html ";

parse(qs, name_value_pairs);

string first = param("first", name_value_pairs, cnt); string last = param("last", name_value_pairs, cnt); string color = param("color", name_value_pairs, cnt); string witch = param("witch", name_value_pairs, cnt);

cout<<""; cout<<"