Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#include #include #include using namespace std; const int SIZE { 1 0 } ; struct SentenceData { int numSwapped [ SIZE ] { } ;

#include
#include
#include
using namespace std;
const int SIZE{10};
struct SentenceData {
int numSwapped[SIZE]{};
string sentence[SIZE]{};
int total{0};
vector rvColors;
vector rvPhrases;
ofstream output;
string resultsOriginal;
string resultSwapped;
string colorFile{ "Colors.txt"};
string sentenceFile{ "Sentences.txt"};
string swapPhrasesFile{ "SwapPhrases.txt"};
string outputFile{ "Out.txt"};
};
void WriteHeader();
void AskForInputFilenames(string& colorFile, string& sentenceFile, string& phraseFile);
string AskForOutputFilename();
bool ReadColors(vector& rvColors, string filename);
bool ReadPhrases(vector& rvPhrase, string filename);
bool ReadSentences(string sentences[], string filename, SentenceData* pData);
bool WriteOriginals(SentenceData& data, int totalSentencesModified, string filename);
bool WriteResults(SentenceData& data, string filename);
int SwapColors(SentenceData& data);
void SayGoodbye();
#endif

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions