Question: solve this question and show answer step by step LAB #2-Hexadecimal Addition Write a program that reads in two hexadecimal numbers from a file, hex.ant,

solve this question and show answer step by step
LAB #2-Hexadecimal Addition Write a program that reads in two hexadecimal numbers from a file, hex.ant, and prints out the sum of the two numbers in hexadecimal. (As noted in class, first do this without using a file and by reading using the cin > command) From Wikipedia: "In mathematics and computer science, hexadecimal (also base 16, or hex) is a positional numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 0-9 to represent values zero to nine, and A, B, C, D, E, F (or alternatively a-f to represent values ten to fifteen. For example, the hexadecimal number 2AF3 is equal, in decimal, to: For example, if the file contains: 45AF 12B3 ..your program will the result in decimal: The decimal sun of 45AF and 12B3 is 22626 (To check your results, you can go to a hexadecimal calculator on the web. For example, http://www.csgnetwork.com/hexaddsubcalc.html) To solve this problem: Read the hexadecimal numbers as character arrays Convert the character arrays to numbers (by calling a function that takes the a) character array as a parameter, and returns an integer) c) Add the numbers to get a decimal sum d) EXTRA CREDIT: convert the sum to hexadecimal (by calling a function that fills a characterarray) Next, LAB 2.5 Assume that your file has an unknown number of hexadecimals. Modify /Enhance Change your program so that it prints the sum o numbers in the file
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
