Question: I need help writing the following code in c++. ECE 275 Homework 2: Number pipeline falled Program Requirements Impliment a class number which is defined

I need help writing the following code in c++.

I need help writing the following code in c++. ECE 275 Homework

ECE 275 Homework 2: Number pipeline falled Program Requirements Impliment a class number which is defined within the namespace lib. a Constructor Impliment a parameterized constructor accepting a long int type argument. This is the number the class stored. Destructor The destructor may be trivial Member functions number::is_prinel) returns bool and accepts no arguments. Return true if the number stored in the object of type number is prime else return false . number::is_even() returns bool and accepts no arguments. Return true if the number stored in the object of type number is even else return false Hint: check if the number is divisable by 2 with the modulo operator . number::is_odd() returns bool and accepts no arguments. Return true if the number stored in the object of type number is . even odd return false Hint: you may return not is_even() . number::get() returns long int and accepts no arguments. Return the value of the parameter used upon construction Optional: I added a member number::info() to print out the results of each member function described above. Impliment this to run the example code given. This member function is not tested. Example.cpp The below example code is given to help develop your program. . #include "number.hpp" #include

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To implement the number class within the namespace lib f... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!