#include #include int main() { try{ double total(0.0); double value(0.0); int count(0); do{ std::cout << "Type in a number. "; std::cout << "(A Value greater than 9999 ends the program) "; std::cin >> value; if(not std::cin) throw std::exception(); if(value > 9999) break; ++count; total+= value; }while(true); if(count == 0) throw std::exception(); std::cout << "The arithmetic mean of the number input is " << total/count << '\n'; } catch(...) { std::cerr << "***An exception was thrown.***\n"; } }