4508l1 Listing 1. Counting Primes class CountPrimes { public: CountPrimes(long start_, long stop_); long total(); private: long start; long stop; long count; bool counted; bool is_prime (long candidate); }; CountPrimes::CountPrimes(long start_, long stop_) :start(start_),stop(stop_),count(0),counted(false){ if (start>=stop) throw range_error("Start >= Stop"); } bool CountPrimes::is_prime (long candidate){ // special cases if (candidate<0) // negative return false; if (!candidate) // == 0? return false; if (candidate==1) // 1 is not considered prime return false; if (candidate==2) return true; // the general case for (long i=2; i1){ cout << "There were " << counter.total(); cout << " primes." << endl; } else{ cout << "There was " << counter.total(); cout << " prime." << endl; }