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),

 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 thecontents 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,

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

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!