Question
C++ Program Create a program to convert decimal numbers to binary, Hexadecimal, and Octal. These functions will return a string, which the main() function will
C++ Program
Create a program to convert decimal numbers to binary, Hexadecimal, and Octal.
These functions will return a string, which the main() function will output.
Follow the requirements below on how to lay out this lab.
Requirements
-
Create a Visual Studio project named CmpSc122_Convert.
-
Create a main() function in the main CPP file.
-
Create 3 functions to convert decimal to hex, binary, and octal.
-
One function for each conversion.
main()
-
Main() shall reside in its own CPP file.
-
Ask user to enter a positive decimal value.
-
Validate the input.
-
Use this decimal value to call the three functions.
-
Output the return values from these functions.
Three Convert functions.
-
The CPP file holding these 3 functions, shall be names ConvFunctions.cpp.
-
string ConvDec2Hex (int decimalValue)
-
string ConvDec2Octal (int decimalValue)
-
string ConvDec2Binary (int decimalValue)
Corresponding .H file.
-
All three convert functions shall have their respective function definitions in this .H file (dont forget these semicolons).
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