C++ myprogramminglab.com hw problem chapter 7 arrays 7.2: Hexadecimal Hexadecima
ID: 657556 • Letter: C
Question
C++
myprogramminglab.com hw problem
chapter 7 arrays
7.2: Hexadecimal
Hexadecimal numerals are integers written in base 16. The 16 digits used are '0' through '9' plus 'a' for the "digit 10", 'b' for the "digit 11", 'c' for the "digit 12", 'd' for the "digit 13", 'e' for the "digit 14", and 'f ' for the "digit 15". For example, the hexadecimal numeral d is the same as base 10 numeral 13 and the hexadecimal numeral 1d is the same as the base 10 numeral 29.
Write a C++ program to perform addition of two hexadecimal numerals each with up to 10 digits. If the result of the addition is more than 10 digits long, then simply give the output message "Addition overflow" and not the result of the addition.
Use arrays to store hexadecimal numerals as arrays of characters .
Input Notes: The program reads two strings , each a sequence of hex digits (no lowercase however) terminated by a "q". Example: 111q AAAq
Output Notes (Prompts and Labels): Each hex input string is prompted for by:
Enter a hexadecimal number of 10 or fewer hex digits
Type q to stop entry of the hex digits
The output consist a display of two 10-digit hex numbers being added as follows:
Explanation / Answer
main.cpp
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.