C Programming Lab Convert Decimal to Hex, Binary, and Octal
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
please need this as soon as possible . please do not copy from other and do it correct way . screnshoot the output and code .
C
Convert Decimal to Hex, Binary, and Octal
Program Requirements
1. The project shall be called: “ConvDecimal_to_OtherBases”.
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.
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 a function (and a corresponding .h file) named ConvDecimal().
i. Make sure you store (and Add) this separate .cppand .h file to your project.
f. 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.
g. This function will return nothing.
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 format.
5. Testing
a. Extensively test your program. Test with all type of integers values; valid and invalid data.
b. I will use a set of test data to evaluate your program.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 4 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education