Determining background and foreground color each pixel on


Assignment: Determining Background and Foreground Color

In the days of yesterday (hear the theme to the Lone Ranger), there were only 16 foreground and background colors; each numbered 0 to 15. White was represented by 15 and black by 0.

Each pixel on the screen had a single byte that stored the background and foreground color. The upper four bits of the byte were the foreground color and the background color was the lower four bytes. (Remember, a single byte can only hold the numbers 0 to 255 in binary).

Write a program that will ask the user for the value that the byte contains then it will tell the user what the foreground and background colors are.

Then, write another program that when given the foreground and background colors it will then display the value that the byte will contain.

Error checking on input for these program is required!!!!!

Output should display the color name and the color value!!!!
Here are what the colors were back in the "good old days:"

0 = Black
8 = Gray

1 = Blue
9 = Light Blue

2 = Green
A = Light Green

3 = Aqua
B = Light Aqua

4 = Red
C = Light Red

5 = Purple
D = Light Purple

6 = Yellow
E = Light Yellow

7 = White
F = Bright White.

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Determining background and foreground color each pixel on
Reference No:- TGS02250855

Now Priced at $30 (50% Discount)

Recommended (93%)

Rated (4.5/5)