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
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
Step by Step Solution
3.38 Rating (160 Votes )
There are 3 Steps involved in it
Step: 1
Program 1 Name of routine CS130Lab2B include include using namespace std function to convert char or ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started