Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a function called binary that will take a decimal number (can assume short int) and return a string of binary digits. Since it is

Create a function called binary that will take a decimal number (can assume short int) and return a string of binary digits. Since it is short int, the largest string of digits would be about 16 assume the number is positive.

Have the main program input the numbers, check to make sure the number is not not negative. If they are print an error message. Otherwise call the binary function and print the answer.

For this, you may have just one file with main and the function together. I Need It To be in C++

For 5 points extra credit, have the binary function handle a negative number.

THANK YOU !

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

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

2 What are the implications for logistics strategy?

Answered: 1 week ago