C++ boot camp + crammingIt's all good until you walk into an interview and see a whiteboard.
![]()

C++ boot camp + crammingIt's all good until you walk into an interview and see a whiteboard.
![]()

google is your friend. search example programs that do something similar and incorporate that codeI can learn it later, I just want to get this done so I can start on my other assignments.![]()

Breh this isn't even that hard. I don't know C++ but I can give you the basic solution in Java and you can translate it to C++.
Code:public static String getty(String str) { String s = ""; s = str.substring(1) + str.charAt(0) + "ay"; return s; }
That method takes in a word and return the word with the first letter moved to the end and "ay" added to the end.

Did you give the effort to do any research? srsCan someone just translate this to C++?![]()
Did you give the effort to do any research? srs
Because here's the very first result that comes up when I type in C++ pig latin.
C++ Pig Latin program
I hate to come off like a dikk but this is legit step 1. If you can't even ask google then you're gonna have a hard time breh.

I don't know your life! lol. Just breathe breh you're gonna survive. Look. Dude basically wrote out the answer in the link.nikka, I've been trying to do this program since Monday, you think I haven't tried Googling it?![]()
void processLine(string _line)
{
string buffer;
string outPutLine;
int lineLen = _line.length();
for (int i = 0; i < (lineLen); i++)
{
if (isspace(_line[i]) || i == (lineLen - 1) || _line[i] == ',' || _line[i] == '.' || _line[i] == '-')// all of our delimiters
{
string temp;
bool lastCharInLineFlag = false;
bool commaOrPeriodAsLastCharInLineFlag = false;
//check if we are on the last char of the line;
if (i == (lineLen - 1))
{
lastCharInLineFlag = true;
//check if the last char is a . or , ...
//if not, add the last char to buffer to get the complete word.
//reason for this check is to make sure the code doesn't process the period or comma as part of the word
if (_line[i] == '.' || _line[i] == ',')
{
commaOrPeriodAsLastCharInLineFlag = true;
}
else
{
buffer = buffer + _line[i];
}
}
//add all the chars after the 1st char
for (int j = 1; j < (int)buffer.length(); j++)
{
temp = temp + buffer[j];
}
if (buffer.length() > 0)
{
//add the first 2 chars from the buffer to the end of temp
temp = temp + buffer[0];
//add a and y
temp = temp + "a";
temp = temp + "y";
}
//attach temp to outPutLine
if (lastCharInLineFlag)
{
if (!commaOrPeriodAsLastCharInLineFlag)
{
outPutLine = outPutLine + temp;
}
else
{
outPutLine = outPutLine + temp + _line[i];// here is where the code adds the period or comma
}
}
else
{
if (_line[i] == ',' || _line[i] == '.')
{
//add period or comma, If the next char is a whitespace, add it to output.
//I did this to catch cases when the next char is == to a '-' which occurs in the file
outPutLine = outPutLine + temp + _line[i];
if (_line[i + 1] == ' ')
{
outPutLine = outPutLine + ' ';
i = i + 1;
}
}
else if (_line[i] == '-')
{
outPutLine = outPutLine + temp + _line[i] + _line[i+1];
i = i + 1;
}
else
{
outPutLine = outPutLine + temp + _line[i];
}
}
//reset buffer
buffer = "";
}
else
{
//add chars to buffer untill we hit one of our delimiters
buffer = buffer + _line[i];
}
}
// write line to output
outputLine(outPutLine);
}
ettyburgGay ddressAay
brahamAay incolnLay
ourFay coresay ndaay evensay earsyay goaay uroay athersfay roughtbay orthfay noay histay
ontinentcay aay ewnay ationnay, onceivedcay niay ibertylay, ndaay edicatedday otay hetay
ropositionpay hattay llaay enmay reaay reatedcay qualeay. owNay eway reaay ngagedeay niay aay
reatgay ivilcay arway, estingtay hetherway hattay ationnay, roay nyaay ationnay osay onceivedcay
ndaay osay edicatedday, ancay onglay ndureeay. eWay reaay etmay noay aay reatgay attlefieldbay foay
hattay arway. eWay avehay omecay otay edicateday aay ortionpay foay hattay ieldfay, saay aay inalfay
estingray lacepay orfay hosetay howay erehay avegay heirtay iveslay hattay hattay ationnay ightmay
ivelay. tIay siay ltogetheraay ittingfay ndaay roperpay hattay eway houldsay oday histay. utBay,
niay aay argerlay ensesay, eway annotcay edicateday--eway annotcay onsecratecay--eway annotcay
allowhay histay roundgay. heTay ravebay enmay, ivinglay ndaay eadday, howay truggledsay erehay,
avehay onsecratedcay tiay, arfay boveaay uroay oorpay owerpay otay ddaay roay etractday. heTay
orldway illway ittlelay otenay, ornay onglay ememberray, hatway eway aysay erehay utbay tiay ancay
evernay orgetfay hatway heytay idday erehay. tIay siay orfay suay hetay ivinglay, atherray otay ebay
edicatedday erehay otay hetay nfinisheduay orkway hichway heytay howay oughtfay erehay avehay
hustay arfay osay oblynay dvancedaay. tIay siay atherray orfay suay otay ebay erehay edicatedday otay
hetay reatgay asktay emainingray eforebay suay,--hattay romfay hesetay onoredhay eadday eway
aketay ncreasediay evotionday otay hattay ausecay orfay hichway heytay avegay hetay astlay ullfay
easuremay foay evotionday--hattay eway erehay ighlyhay esolveray hattay hesetay eadday hallsay
otnay avehay iedday niay ainvay--hattay histay ationnay, nderuay odGay, hallsay avehay aay ewnay
irthbay foay reedomfay--hattay overnmentgay foay hetay eoplepay, ybay hetay eoplepay, orfay hetay
eoplepay, hallsay otnay erishpay romfay hetay artheay.
nikka, I've been trying to do this program since Monday, you think I haven't tried Googling it?![]()
Surprised there are so many coders here. Weird.

Surprised there are so many coders here. Weird.

Surprised there are so many coders here. Weird.
;