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

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!