Question: please use C++ to solve C5 2413 - Data Structures Fall 2019 LAB 4 - Oct 02, 2019 Acknowledge your collaborators or source of solutions,

 please use C++ to solve C5 2413 - Data Structures Fall

please use C++ to solve

C5 2413 - Data Structures Fall 2019 LAB 4 - Oct 02, 2019 Acknowledge your collaborators or source of solutions, if any. This exercise is to enhance your skill in implementing solution using Stack. Please be advised that a menu driven program is required. Problem 1. a. Write a program to convert a number from decimal notation to a number expressed in a number system whose base (or radix) is a number between 2 and 9. The conversion is performed by repetitious division by the base to which a number is being converted and then taking the remainders of division in the reverse order. For example, in converting to binary, number 6 requires three such divisions: 6/2=3 remainder 0,3/2=1 remainder 1, and finally, 1/2=0 remainder 1. The remainders 0, 1, and 1 are put in reverse order so that the binary equivalent of 6 is equal to 110. b. Modify the program in part (a) so that it can perform a conversion in the case when the base is a number between 11 and 27. Number systems with bases greater than 10 require more symbols. Therefore, use capital letters. For example, a hexadecimal system requires 16 digits: 0, 1,..., 9, A, B, C, D, E, F. In this system, decimal number 26 is equal to 1A in hexadecimal notation because 26/16 = 1 remainder 10 (that is, A), and 1/16=0 remainder 1. Example of a running demonstration: Please enter a decimal number: 6 Please enter the conversion base: 2 Your base 2 representation of the number 6 is: 110 Note: Using stack to solve the above problems. You are free to decide internal representation of the Stack (arrays or linked list). You can design a separate algorithm for each part OR generalize it to one algorithm for both parts

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!