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

1 Expert Approved Answer
Step: 1 Unlock

Program 1 Name of routine CS130Lab2B include include using namespace std function to convert char or ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Electrical Engineering Questions!