I am trying to make it so if the user enters a number less than 4 or greater them 10 they are prompted it is invalid and to enter a new number. the problem I am having is if they do enter a proper number it does not continue on to the next part. Here is what I have so far:
#include <iostream>
#include <iomanip>
#include <string>
#include <fstream>
#include <cstdlib>
#include <ctime>
int NewRandomNumber (int n);
void MakeQuestion (int n, int& a, int& b, int& atimesb);
bool UserAnswer (int a, int b, int atimesb);
void PrintScore (int numCorrect, int numAsked);
using namespace std;
int main()
{
string name;
int n;
string s;
cout << "Welcome to Multiplication Quiz 1000!" << endl;
cout << "Firstly what is your name?\n" << endl;
cin >> name;
cout << "\nHi " << name <<" !" << endl;
cout << "What difficulty would you like your quiz to be? Enter a value from [4 to 12]
\nwith 4 being the easiest:\n" << endl;
do
{
cin >> s;
n = atoi(s.c_str());
if ( n >= 4 || n <= 10)
if ( n < 4 || n > 10)
{cout << "invalid. try again" << endl;
}
{cout << "Ok" << endl;
cout << NewRandomNumber (4);
}
}
while ( n >= 4 || n <= 10);
return 0;
}
int NewRandomNumber (int n)
{
n = rand()% 10 + 1;
return (n);
}
void MakeQuestion (int n, int& a, int& b, int& atimesb)
{
}