
Write a C++ program to convert a hexadecimal number to binary. Your program should read (from the keyboard) a hexadecimal number (like7A3, for example.) It should then print out the binary equivalent number. You don’t have to print leading zeros.; you can print them if you want.
You should do this using a function. The function should do the conversion. The main() function should read in the hex number, call the function to convert it to binary, and then print out the binary number.
Your source should contain calls to your function demonstrating that it works. You can do this by showing sample runs. Cut and paste the results of the runs into a separate document and submit that to Canvas.
You can limit input. You should accept at least four-digit hex numbers.
What to Submit:
Two separate documents. Submit your source. Submit the results of your sample run(s). Canvas is set to accept .cpp, .c, and .txt files.

Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 2 images

- Write a function that displays all the numbers between two integers in n lines, that are divisible by 5 or 7 (not by both). So, the function should take as parameters the minimum and maximum of integer numbers and n. If no values are passed to them, this function should display the numbers between 1 and 100 in 10 lines. Write a test program to test your function. just in C++arrow_forwardCan someone help me to fix my user-defined, value-returning expression? Here's the instructions to my C++ Program: Instructions Write a value-returning function, isVowel, that returns the value true if a given character is a vowel and otherwise returns false. For the input E, your output should look like the following:E is a vowel: 1 When printing the value of a bool, true will be displayed as 1 and false will be displayed as 0. And here's what I have so far: //Declare include-header files#include <iostream> #include <string.h> //Declare namespace statementsusing namespace std; //Define the isVowel userdefined value-returning functionint isVowel(char ch){if ((ch == 'A') || (ch == "E") || (ch == 'I') || (ch == "O") || (ch == "U") || (ch == 'a') || (ch =='e') || (ch == 'i') || (ch == 'o') || (ch == 'u')) {return true;}else{return false;}}} int main() //Define the main function{//Define variableschar character; //Testing the isVowel function.//Prompt the user to input a…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





