Answer to Question #40452 in C++ for gabe graham

Question #40452
I have an infinite loop in this program. Please help


#include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
#include <cctype>

using namespace std;

void PrintMenu(); //The Menu to be printed out
void IntSelect(int&, char); //To decide if a menu option was selected
void OpenFile(ifstream&, string&); //Opening a file
void countVow(int, char&, ifstream&);
void countCon(int num3, char ch3, ifstream& inFile, int ch2);//Counting vowels and consonants

int main()
{
int num1 = 0, num2, num3;
float fnum1, fnum2, fnum3;
string filename;
bool endLoop = false;
char ch = 'a', ch2, ch3;


ifstream inFile;

while (!endLoop)
{
PrintMenu();
IntSelect(num1, ch);
cout << num1 << endl;
cin.ignore (2000, '\n');

if (num1 == 1 || num1 == 2)
{
OpenFile(inFile, filename);
if (num1 == 1)
{
countVow(num2, ch2, inFile);
}
else;
countCon(num3, ch3, inFile, ch2);
}
else if (num1 == 0)
{
endLoop = true;
}
else
cout << string(10, '*') << " Invalid Se
0
Expert's answer

Answer in progress...

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS