New folder (2)/screenshot XXXXXXXXXXe40evnuf.png New folder (2)/screenshot XXXXXXXXXXupvwr20d.png New folder (2)/screenshot XXXXXXXXXXfgvnzypa.png New folder (2)/screenshot XXXXXXXXXXqgwcy1b1.png New...

1 answer below »
I'm not sure what the referencing style means so i chose randomly



New folder (2)/screenshot-2021-05-04-182913-e40evnuf.png New folder (2)/screenshot-2021-05-04-183007-upvwr20d.png New folder (2)/screenshot-2021-05-04-183057-fgvnzypa.png New folder (2)/screenshot-2021-05-04-183128-qgwcy1b1.png New folder (2)/screenshot-2021-05-04-183205-chbnqw0k.png New folder (2)/screenshot-2021-05-04-183235-vdy2hvyk.png New folder (2)/screenshot-2021-05-04-183313-owmp5ydz.png
Answered 4 days AfterMay 04, 2021

Answer To: New folder (2)/screenshot XXXXXXXXXXe40evnuf.png New folder (2)/screenshot XXXXXXXXXXupvwr20d.png...

Vaishnavi R answered on May 06 2021
147 Votes
#include
#include
#include
#include
#include
#include
using namespace std;
bool checkCorrectFile(string mainStr)
{
string toMatch = ".txt";
if(mainStr.size() >= toMatch.size() &&
mainStr.compare(mainStr.size() - toMatch.size(), toMatch.size(), toMatch) == 0)
return true;
else
return false;
}
int checkWordCount(string path,string (&wordList)[1000])
{

int count=0;
ifstream randomWord;
randomWord.open(path);
if(randomWord.is_open())
{
while(randomWord.peek()!=EOF)
{
randomWord>>wordList[count];
// cout< count++;
}

randomWord.close();

}
else
{
cout<<"failed to open the file!";
}
return count;
}
int readfileName(string (&wordList)[1000])
{
bool flag = true;
int count = 0;
while(flag == true)
{
cout<<"Enter the file name with word list : \n";
string filename;
cin>>filename;
if(checkCorrectFile(filename))
{
flag = false;
// string path = "E:\\vaishnavi\\greynodes\\curr\\hangmanProg\\"+filename;
string path = filename;
count = checkWordCount(path,wordList);
// cout<<"inside readfile name function "fr< }
else
{
cout<<"This file is not valid \n";
}
}
return count;
}
int findlength(string s)
{
int count=0;
for (int i=0; s[i]!='\0'; i++)
{

count++;
}
return count;
}
bool isitdigit(char c)
{
if(c>='0' &&...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here