•Design a class named MyInteger.The class contains the following:
•An intdata field named value that stores the intvalue represented by this object.
•A constructor that creates a MyIntegerobject for the specified intvalue.
•A constant get function that return the intvalue.
•Constant functions isEven(),isOdd(),isPrime()that return true if the value is even, odd, or prime, respectively•Static functions isEven(int),isOdd(int),isPrime(int)that return true if the specified value is even, odd, or prime, respectively.
•Static functions isEven(constMyInteger&),isOdd(constMyinteger&),isPrime(constMyInteger&)that returns true I f the specified value is even, odd, or prime, respectively.
•Constant functions equals(int)and equals(constMyInteger&)that return true if the value in the object is equal to the specified value.
•A static function parseInt(conststring&) that converts a string to an intvalue.•Implement the class and write a programto test all functions in the class.
myinteger.h
#include <string>
myinteger.cpp
#include "myinteger.h"谢谢,把运行的主函数也敲给我吧,麻烦了!
追答myinteger.cpp
#include "myinteger.h"非常感谢,不过- - CODEBLOCKS我自己都还没建过工程导致大牛的代码还没运行 不过也已经万分感谢了~