program #1 Write a C/C++ console program to convert a char or a char string to its
Question:
program #1
Write a C/C++ console program to convert a char or a char string to its decimal, hexadecimal, and binary ASCII values.
Name the routine CS130_Lab2B.
Must request a char string from one to 4 char's long.
If the user enters any thing else, let them know and give them the opportunity to reenter a valid string.
Compute the decimal, hexadecimal, and binary ASCII values and display in four rows. Example:
String entered: A1t!
DEC: 65 108 116 33
HEX: 41
BIN:
ASCII Table - ASCII codes,hex,decimal,binary,html (rapidtables.com)
?----------------
Program #2
part A:
Use CS130_Lab2A to get a decimal number from a user and convert it to binary.
Name the routine CS130_Lab2.
Next, shift the binary value 1 bit to the left.
Now, convert the shifted binary back to decimal and display it.
Example:
Input: 23
(Internal operations: Shift the binary left once; then convert it back to decimal.)
Output: 46
Part B:
Use CS130_Lab2B to get accept an Upper Case letter from the user. Change the input validation to ensure only one letter from A-Z is accepted.
Name the routine CS130_Lab2D.
OR the binary ASCII with 0010 0000 binary.
Print out the result.
Example:
Input: B
Output: b
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill