Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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++.
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" #includeStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started