Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Task 2 - Constructors For the BitsByte class add the following constructors in addition to the default constructor above: Constructors: C + + BitsByte (
Task Constructors
For the BitsByte class add the following constructors in addition to the default constructor above:
Constructors:
C
BitsByteint ar Sets the data section with the value found in the array. Note: the array should be a size of and should hold a binary representation of a whole number
BitsByteint val Sets the data section to val
BitsBytestring val Sets the value of the data section to the value found in val. Note: val should be a string representation of a binary number.
Java
BitsByteint val Sets the bits correctly for the value being passed in For instance, if you input the bits should be or stored as
BitsByteint ar Stores the values in the array to the appropriate bits. Please note that you need to make sure that each value of the array contains either a or a If it does not set all bits to
Task Functionality
Add the following functions to your BitsByte class.
add
sub
mul
div
Each of these takes as an argument a primitive int variable and returns a complex type BitsByte that contains the answer.
Example Run:
C
int main
BitsByte bite;
BitsByte b bite.add;
cout "Int: btoInt endl;
cout "String: btoString endl;
return ;
Step 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