Exclude any existing source code files that may already be in your IDE project and add a new one, naming it C1A3E2_main.

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Exclude any existing source code files that may already be in your IDE project and add a new one, naming it C1A3E2_main.

Post by answerhappygod »

Exclude Any Existing Source Code Files That May Already Be In Your Ide Project And Add A New One Naming It C1a3e2 Main 1
Exclude Any Existing Source Code Files That May Already Be In Your Ide Project And Add A New One Naming It C1a3e2 Main 1 (73.96 KiB) Viewed 39 times
Exclude any existing source code files that may already be in your IDE project and add a new one, naming it C1A3E2_main.cpp. Write a program in that file to reverse the digits of an arbitrary user-entered hexadecimal integer value based solely upon its numeric value, not the individual characters entered. If the value is negative the minus sign must be displayed last. If you are not familiar with the hexadecimal number system, see note C.1. Here are some sample input values and the expected reversals: Input aBcD -26C5 100 000120 -002F 000 Reversal dcba 5c62- 001 021 f2- 0 Your program must interpret all integer input and display all integer output as hexadecimal (notes 1.14 and 1.12, respectively). Your program must: • prompt the user to enter any hexadecimal integer value and use cin >> to read the entire value at once into a type int variable. • use cout << as often as necessary to display the variable's value and the reversed value in the format below, placing double quotes around both for readability. For example, if the user input is -90099999999999999999999Ab459 the following would get displayed: "-ab450" in reverse is "054ba-" • not declare variables or use casts that are not type int or type bool. not use anything involving floating point types (the pow function, math.h, type double, etc.). • not use arrays or recursion; recursion occurs when a function is called before a previous call to that function has returned, for example, when a function calls itself. • not use any separate code to handle a user input of zero. Uppercase/lowercase does not matter for the 6 hex letters. Manually re-run your program several times, testing with at least the following 6 input values: 3-A2b 0 10c0 -1010-000F000
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply