Trying to figure out bool...

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#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;
}


Thanks in advance for any help
It's do ... while (...);, not do {...}.
Topic archived. No new replies allowed.