Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CmpSc 3 3 0 , C + + Lab Convert Decimal to Binary, Hexadecimal and Octal Programming guidelines Use Visual Studio, and create a C

CmpSc330, C++ Lab
Convert Decimal to Binary, Hexadecimal and Octal
Programming guidelines
Use Visual Studio, and create a C++ project.
Create a comment header, at the top of the document.
Deliverables
Only submit .CPP and .H files, that you created.
Program Requirements
1. The project shall be called: ConvertDecimal.
2. Input
a. Allow user to input an integer from 0->2,000,000.
b. Validate the input. If input is invalid, make them enter a value again
(while), until they enter a valid value.
c. Then, the main() call the ConvDecimal() with the appropriate parameters.
3. Processing
a. Use the Division method for converting Decimal to Binary, and
Hexadecimal, and Octal.
i. Divide the quotient by 2 or 16 or 8, respectively.
ii. Get the remainder after dividing. Save the remainders. They are
the answer.
b. Display the answer with, the digits, in the proper order.
c. Loop and ask user to input another positive integer.
d. Stop looping and exit when the user enters -1.
e. Create 4 functions to reside in this one .CPP file.
i. convDecimal().
ii. convDecimalToHex ();
iii. ConvDecimalToOctal();
iv. convDecimalToBinary().
v. You will create 1 function that will convert Decimal to all 3 other
bases (2,16, and 8). You (the programmer) need to determine what
the parameters should be for this function. Then, this function will
call the appropriate other function.
f. All 4 functions will return a string with the values in the correct order.
4. Output
a. At beginning of the program, display some kind of welcome message,
stating to the user what this program does.
b. When printing the results, display both the original decimal value and the
calculated values.
c. Display the output in a nice, easy to read, format.
5. Testing

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: 3

blur-text-image

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

MySQL Crash Course A Hands On Introduction To Database Development

Authors: Rick Silva

1st Edition

1718503008, 978-1718503007

More Books

Students also viewed these Databases questions

Question

1. Identify three communication approaches to identity.

Answered: 1 week ago

Question

d. Who are important leaders and heroes of the group?

Answered: 1 week ago

Question

3. Describe phases of minority identity development.

Answered: 1 week ago