Professional Documents
Culture Documents
Лабораторна Робота Номер 6
Лабораторна Робота Номер 6
// Check for the validity of the value of A (it should be greater than or equal to
0)
if (A < 0) {
std::cout << "Error: A should be greater than or equal to 0." << std::endl;
return 1;
}
// Number of possible value categories (from 0 to 20 inclusive)
const int numCategories = 21;
// Check for the validity of values (they should be in the range from 0 to 20)
if (value < 0 || value > 20) {
std::cout << "Error: Values should be in the range from 0 to 20." <<
std::endl;
return 1;
}