Hi I have been getting the following errors when running my code and cannot figure out why my checking of the user data using bool doesn't work the second time I try to use it? I am getting the following errors:
line 23 --> error: expected 'while' before 'acceptG'
line 23 --> error: expected '(' before 'acceptG'
line 23 --> error: 'acceptG' was not declared in this scope
line 23 --> error: expected ')' before ';' token
line 34 --> error: expected 'while' before ';' token
line 34 --> error: expected '(' before ';' token
line 34 --> error: expected primary-expression before ';' token
line 34 --> error: expected ')' before ';' token
#include "userData.h"
void getUserData(int &gaussOrder, int &noIntervals, double &xBeg, double &xEnd) {
cout << "\nEnter the upper limit of integration: " << xBeg << endl;
cin >> xBeg;
cout << "\nEnter the lower limit of integration: " << xEnd << endl;
cin >> xEnd;
bool acceptI = false; //accept the user interval?
do {
cout << "\nEnter the number of intervals into which to divide the domain (must be an even, positive number): " << noIntervals << endl;
cin >> noIntervals;
if (noIntervals % 2 != 0|| noIntervals >= 2){
cout << "The number of intervals must be an even, positive number!: ";
acceptI = false;
}
else
acceptI = true;
}
bool acceptG = false; //accept the user defined Gaussian order?
do {
cout << "\nEnter the order for Gaussian quadrature (up to and including 3rd order): " << gaussOrder << endl;
cin >> gaussOrder;
if (gaussOrder <= 2 || gaussOrder <= 3){
cout << "The order must be less than or equal to 3!: ";
acceptG = false;
}
else
acceptG = true;
}
return;
}