Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Demonstrate how to use the Gaps Model for diagnosing and

Answered: 1 week ago