Changed exception to Unsolved to fit with naming convention

This commit is contained in:
2020-07-19 13:23:57 -04:00
parent 0caa043b59
commit 22871b71e9
33 changed files with 112 additions and 104 deletions

View File

@@ -82,7 +82,7 @@ void Problem12::reset(){
std::string Problem12::getString() const{
//If the problem hasn't been solved throw an exception
if(!solved){
throw unsolved();
throw Unsolved();
}
std::stringstream results;
results << "The triangular number " << sum << " is a sum of all numbers >= " << counter - 1 << " and has " << divisors.size() << " divisors";
@@ -93,7 +93,7 @@ std::string Problem12::getString() const{
int64_t Problem12::getTriangularNumber() const{
//If the problem hasn't been solved throw an exception
if(!solved){
throw unsolved();
throw Unsolved();
}
return sum;
}
@@ -102,7 +102,7 @@ int64_t Problem12::getTriangularNumber() const{
int64_t Problem12::getLastNumberAdded() const{
//If the problem hasn't been solved throw an exception
if(!solved){
throw unsolved();
throw Unsolved();
}
return counter - 1;
}
@@ -111,7 +111,7 @@ int64_t Problem12::getLastNumberAdded() const{
std::vector<int64_t> Problem12::getDivisorsOfTriangularNumber() const{
//If the problem hasn't been solved throw an exception
if(!solved){
throw unsolved();
throw Unsolved();
}
return divisors;
}
@@ -120,7 +120,7 @@ std::vector<int64_t> Problem12::getDivisorsOfTriangularNumber() const{
size_t Problem12::getNumberOfDivisors() const{
//If the problem hasn't been solved throw an exception
if(!solved){
throw unsolved();
throw Unsolved();
}
return divisors.size();
}