Include Numberh Include Include Number Number Default Constructor Thenumber 0 Int Number G Q37120506

#include “Number.h” #include #include Number::Number()// DefaultConstructor { the_number=0; } int Number::getNum() // get thefunction { return the_number; } void Number::setNum(int num) // SetFunction { the_number=num; } bool Number::isPrime()// Check to seeif prime { int n=sqrt(the_number); for(int i=2;i<=n;i++) {if(the_number%i == 0) return false; } return true; } boolNumber::isPositive()// Check to see if positive {if(the_number>0) return true; return false; } boolNumber::isEven()// Check to see if even { if(the_number%2 == 0)return true; return false; } bool Number::isMulti3()// checkmultiple of 3 { if(the_number%3 == 0) return true; return false; }Another Number class Modify your Number class from last week.Change the setNum function to only

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.