Question: Data Structures Stacks in (ct) Write a program that can be used to convert a number from binary to decimal Your program must have a

 Data Structures Stacks in (ct) Write a program that can be

Data Structures Stacks in (ct) Write a program that can be used to convert a number from binary to decimal Your program must have a Binary class that implements the methods shown in Table 1 below Your Binary class must include a member variable of type BinStack that stores a binary number, putting the high order bit at the bottom of the stack and the low order bit at the top of the stack. RinStack must be a dynamic stack that implements the standard Stack operations: push, pop, and isEmp ng with a default constructor and a destructor. BinStack should only allow values of 0 and 1 to be added to the stack. Stores a binary value. passed in as a c-style string (null-terminated array of characters showValue Prints the currently stored value with the high-order bit first (on the left) and the low- order bit last (on the right). Non-destructive implementation getDecimal Returns the decimal equivalent of the currently stored value as an int. Non-destructive implementation Returns the hexadecimal equivalent of the currently stored value as a c-style string Non-destructive implementation Empties the current value Creates a Binary object with an empty value Default constructor 2nd Constructor Creates a Binary object with an initial value, passed in as a c-style string (null terminated array of characters Use the names as shown above Write a main program to test your Binary class. It should include a menu that allows the user to: enter a binary value (stored internally as a c-string), get the decimal equivalent of the currently stored value, get the hexadecimal equivalent of the currently stored value, or clear the current value Write your classes and main program. Use a separate h and cpp file for each class. You also need a separate CRR file for your main program. Compile, run and test your classes and program Your output should be well-organized, neat, and easy to read

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 Databases Questions!