Question: Write progeam with C + + : 1 . Write all programs in cross - platform C + + 2 . No Containers, NO STL

Write progeam with C++:
1. Write all programs in cross-platform C++
2. No Containers, NO STL allowed {Vector, Lists, Sets, etc...}
3. Simple Old-fashion C++. No modern C++
4. No Adding files
Nyble Class - Description
1. Background : This is class creates an abstract data type, Nyble (4 bits) with overloaded operators.
You can add numbers to this data type, it will mask if it exceeds the 4 bits of storage.
2. private: Storage of the 4 bit data (actually its 8, but we are treating it as 4 bit).
3. public: Method getData() returns the data
4. Methods to Add : The Big Four operators to public methods (explicitly - no defaults)
a. Default constructor
b. Copy constructor
c. Assignment operator
d. Destructor operator
e. Binary operators
Nyble + constant
constant + Nyble
Nyble + Nyble
Nyble += Nyble
f. Unary operators
~ operator : Ones complement
+operator : returns the value +3(for academic purposes)
casting operator() to an unsigned int : subtracts 3 to the value (for academic purposes)
pre-increment ++ : ++Nyble
post-increment ++ : Nyble++
operator <<
o Use as a rotational shift function within the nyble
o Each bit rotates to the left by the number specified
o If a bit fall off the edge it is rotated to the beginning bit.
x: 1110b x<<1 answer x: 1101b
Nyble.h:
#ifndef NYBLE_H
#define NYBLE_H
class Nyble
{
public:
// insert your code here
unsigned char getData();
//----------------------------------------------------------------------------
// Do not add extra data in class
//----------------------------------------------------------------------------
private:
// Do not change this data
unsigned char data;
};
#endif
//--- End of File ---
Nyble.cpp:
#include "Nyble.h"
unsigned char Nyble::getData()
{
return this->data;
}
//--- End of File ---

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Programming Questions!