HTTP is the protocol that governs communications between web servers and web clients (i.e. browsers). Part of the protocol includes a status code returned by the server to tell the browser the status of its most recent page request. Some of the codes and their meanings are listed below:200, OK (fulfilled)403, forbidden404, not found500, server errorGiven an int variable status, write a switch statement that prints out the appropriate label from the above list based on status.

Respuesta :

Answer:

switch( status ){

case 200:

cout << "OK (fulfilled)";

break;

case 403:

cout << "forbidden";

break;

case 404:

cout << "not found";

break;

case 500:

cout << "server error";

break;

}

Explanation:

The HTTP is a web service also known as hypertext transfer protocol used for delivering web packets on a web server.

The server could either send the requested web pages or send a web error code sent by the http protocol. The router routes the packet to the switch, but the switch can only deliver the codes and not the meaning of the codes.

For a user to understand the error code a meaning is assigned to the codes on the switch, using C++ programming language.