Please solve usnig c++ programming language. Number Converter Program as described in the UML has the following functionality. 1. Read a number from the user and find its base. If number is exceeding the limit of 16-bits, ask user to re-enter the number. Use parameterized constructor Conversion(char *) to initialize the data member. int FindBase(char []); There are a few assumptions. i) If all digits of a number are 0 or 1, the number is binary. For example, 1010 will be considered a Binary number only. ii) A hexa-decimal number must have letter A, B, C, D, E or F. Otherwise the number will not be considered a hexa-decimal. iii) Decimal number must have minimum one digit greater than 7. Otherwise, the number can be considered as Octal if it does not meet the criteria in point no. i and ii. 2. Converting the number to Binary if the number is not Binary.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Please solve usnig c++ programming language.

Number Converter Program as described in the UML has the following functionality.
1. Read a number from the user and find its base. If number is exceeding the limit of 16-bits,
ask user to re-enter the number. Use parameterized constructor Conversion(char *) to
initialize the data member.
int FindBase(char []);
There are a few assumptions.

i) If all digits of a number are 0 or 1, the number is binary. For example, 1010 will be
considered a Binary number only.
ii) A hexa-decimal number must have letter A, B, C, D, E or F. Otherwise the number will
not be considered a hexa-decimal.
iii) Decimal number must have minimum one digit greater than 7. Otherwise, the number
can be considered as Octal if it does not meet the criteria in point no. i and ii.
2. Converting the number to Binary if the number is not Binary.
char * ToBinary(char *);
3. Converting the number to Octal if the number is not Octal.
char * ToOctal(char *);
4. Converting the number to Hexa-decimal if the number is not Hexa-decimal.
char * ToHexaDecimal(char *);
5. Converting the number to Decimal if the number is not Decimal.
char * ToDecimal(char *);

Note: You may convert char * to char [] etc. within a function but function parameters and
return type cannot be changed.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 3 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education