Unformatted text preview: integers (code for a stack class has been posted to the website for you to use). Using a stack object, you will push the results of your computation (loop using % and /) as you get them (one digit at a time, as an integer). Once done, you will pop the values from the stack to get them in the right order and use another loop to “cout” them. In this output loop (while “popping” the values, you will need to handle the values (intBuffer) that may be greater then 9 when dealing with hexadecimal. This can be done using code similar to: if (intBuffer > 9) cout << char('A' + intBuffer - 10); // displays digit > 9 as char else cout << intBuffer; In addition to these labs, also review the Word document “Session 9” that has been posted to the website. Please refer to our textbook, chapter “Lesson 11” for additional information. Page 1 of 1...
View Full Document
- Spring '06
- Computer Science, Binary numeral system, Decimal, one digit, c++ programming assignment