Answered step by step
Verified Expert Solution
Question
1 Approved Answer
From the supplemental material you should have observed that a byte consists of 8 - bits. To store these 8 - bits of information we
From the supplemental material you should have observed that a byte consists of bits. To store these bits of information we are going to need an array. In the data section of the class create an array called bits that will hold integer values to store the s and s for the Byte.
As an example, if we were to store the values in the data section of our class. The int array will hold
Create the following utility function:
int bitsTolnt this function will return the bit values stored in the data section as an int whole number value.
Public Methods:
Create the following functions methods :
void setValueint value this function will take as an argument an int type. The argument is going to be the value we want to set our bits to To set the bits we are going to have to use some bitwise operators. Here is how it works.
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