Question: Declare a Boolean variable named allMatch. Then, read integer numInput from input representing the number of integers to be read next. Use a loop to

Declare a Boolean variable named allMatch. Then, read integer numInput from input representing the number of integers to be read next. Use a loop to read the remaining integers from input. If all of the numInput integers are in the range 90 to 100 inclusive, assign allMatch with true. Otherwise, assign allMatch with false.
Code at the end of main() outputs "All match" if allMatch is true or "Value(s) out of range" if allMatch is false.
Ex: If the input is:
2
95120
then the output is:
Value(s) out of range #include
using namespace std;
int main(){
int numInput;
/* Additional variable declarations go here */
/* Your code goes here */
if (allMatch){
cout << "All match" << endl;
}
else {
cout << "Value(s) out of range" << endl;
}
return 0;
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!