Code below will not create the file needed for the descrambling word game below: Help me create the file needed to complete the game in C++ and make the game timed. #include #include #include #include using namespace std; string sortString(string word) { transform(word.begin(), word.end(), word.begin(), ::toupper); sort(word.begin(), word.end()); return word; } void jumbledString(string jumble) { string checkPerWord = ""; string userEnteredAfterSorting; userEnteredAfterSorting = sortString(jumble); ifstream word("Game.txt"); if (word) { while (getline(word, checkPerWord)) { string Ch = sortString(checkPerWord); if (Ch == userEnteredAfterSorting) { cout << checkPerWord << endl; } } word.close(); } } int main() { string string = "tac"; jumbledString(string); return 0; } int main1() { string string = "tac"; jumbledString(string); return 0; }
Code below will not create the file needed for the descrambling word game below:
Help me create the file needed to complete the game in C++ and make the game timed.
#include <iostream>
#include <algorithm>
#include <fstream>
#include <string>
using namespace std;
string sortString(string word)
{
transform(word.begin(), word.end(), word.begin(), ::toupper);
sort(word.begin(), word.end());
return word;
}
void jumbledString(string jumble)
{
string checkPerWord = "";
string userEnteredAfterSorting;
userEnteredAfterSorting = sortString(jumble);
ifstream word("Game.txt");
if (word) {
while (getline(word, checkPerWord)) {
string Ch = sortString(checkPerWord);
if (Ch == userEnteredAfterSorting) {
cout << checkPerWord << endl;
}
}
word.close();
}
}
int main()
{
string string = "tac";
jumbledString(string);
return 0;
}
int main1()
{
string string = "tac";
jumbledString(string);
return 0;
}
Step by step
Solved in 4 steps with 1 images