Question: C++ Sample Main to copy #include #include #include server.h #include client.h #include messageServer.h #include encodedServer.h #include utility.h using namespace std; int main() { client Client1(1),






![string * tracker = fileContents; input1 = fileContents[0]; tracker++; input2 = fileContents[1];](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f52904af7c2_85266f529044bd04.jpg)

!["y" || input2 == "Y")) { userChoice = fileContents[2]; tracker++; if (userChoice](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f529060b640_85366f5290585759.jpg)

C++
Sample Main to copy
#include
#include
#include "server.h"
#include "client.h"
#include "messageServer.h"
#include "encodedServer.h"
#include "utility.h"
using namespace std;
int main() {
client Client1(1), Client2(2);
messageServer server1;
encodedServer server2;
utility utilityObj;
string input1 = "", input2 = "", userChoice = "";
string printOutput;
string fileName;
cin >> fileName;
/*
fileContents - pointer to array of string. Stores the contents of
the entire input file.
*/
string * fileContents = utilityObj.readInputFromFile(fileName);
string * tracker = fileContents;
input1 = fileContents[0];
tracker++;
input2 = fileContents[1];
tracker++;
if ((input1 == "y" || input1 == "Y") && (input2 == "y" || input2 == "Y")) {
userChoice = fileContents[2];
tracker++;
if (userChoice == "y" || userChoice == "Y") //use encoded server
{
utilityObj.encodedConnection(Client1, Client2, server2, tracker);
} else // use normal messageServer
{
utilityObj.standardConnection(Client1, Client2, server1, tracker);
}
} //if ends
else {
printOutput = "No connection made.";
cout
exit(0);
}
printOutput = utilityObj.outputString();
cout
return 0;
}
Description This homework will simulate encrypted communication between two clients, who are connected via a server. There will be five classes required in total. This means you will need to turn in 11 files-server.h, server.cpp, client.h, client.cpp, messageServer.h, messageServer.cpp, encodedServer.h, encodedServer.cpp,utility.h,utility.cpp, main.cpp. Class Description's: Server Class Abstract Class Protected: o Pointer sender of type Client o Pointer receiver of type Client Public: o Pure virtual function establishConnection () o Pure virtual function sendMessage () o swapClients () This function should be defined within the server.cpp file Description This homework will simulate encrypted communication between two clients, who are connected via a server. There will be five classes required in total. This means you will need to turn in 11 files-server.h, server.cpp, client.h, client.cpp, messageServer.h, messageServer.cpp, encodedServer.h, encodedServer.cpp,utility.h,utility.cpp, main.cpp. Class Description's: Server Class Abstract Class Protected: o Pointer sender of type Client o Pointer receiver of type Client Public: o Pure virtual function establishConnection () o Pure virtual function sendMessage () o swapClients () This function should be defined within the server.cpp file
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
