Question: In c++ please 8.32 Project 3: Bits Define a class named Bits that holds a single integer variable. You will use this integer simply as


In c++ please
8.32 Project 3: Bits Define a class named Bits that holds a single integer variable. You will use this integer simply as a container of bits. The number of bits you can support depends on the type of integer you use. We will use an unsigned long long, which on most platforms occupies 64 bits. However, DO NOT HARD-CODE the type of integer you use throughout your code. You should be able to change only one line of code for your class to work with a different size integer (see the using statement on the second code line below). The code skeleton below gets you started, and also shows you the interface your class needs to implement. I gave you the code for some of the functions. The body of at should help you with many other functions. I have also defined for you the following non-member, friend functions: - an output stream operator (== - the inequality operator ! = Remember that bit positions are numbered right-to-left, so bit-position 0 is the low-order (right-most) bit. "Rotate' means that bits that fall off one end replace the vacated bits on the other (in the same order as they appeared originally). Define all functions inline in a header file named bits. h. rotate is the most interesting function to implement. I suggest that you develop your code offline in the development environment of your own choice, implementing and testing one function at a time. When you are satisfied everything is working, submit your code for grading. Something think about What will you do if a user of your Bits class tries to use a bit position out of range of what the integer holds? You can just use asserts for now, as shown above. Remember Never use using namespace std; in a header file! Hints Don't use unadorned constants when shifting or forming masks. For example, instead of 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
