Determine background and foreground color

Assignment Help C/C++ Programming
Reference no: EM131455286

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.

Reference no: EM131455286

Questions Cloud

Calculate the midpoint index of the array by taking mean : Calculate the midpoint index of the array by taking mean of the index of the first and the last array elements. The element at mid-point index is called ‘m'.
Does the decision make sense to you : The employee, Pime, brought suit against the university under Title VII for religious discrimination in the hiring of tenure track professors in its College.
Promoting diversity and racial equality : What evidence can you locate that unions, in general, have a good or bad track record in promoting diversity and racial equality?
Review the case peterson v hewlett-packard co : Employee sued employer for religious discrimination and alleged religious harassment after being terminated for repeatedly refusing to remove biblical passages.
Determine background and foreground color : Determining Background and Foreground Color. Each pixel on the screen had a single byte that stored the background and foreground color.
Discuss the importance of leadership team : Discuss the importance of leadership team buy-in of the strategy. Discuss the use of at least two analytical tools in performing a situational analysis
Prepare a common-size statement for the balance sheet : ACC305- Auditing and Assurance Services - Prepare a common-size statement for the balance sheet of Cloud 9, use total assets as the basis for the balance sheet - perform an analysis of Cloud 9's financial position and its business risks. Discuss the..
Write program that ask user which bit in a signed short int : Write a program that will ask a user which bit in a signed short int that they would like to switch its value (from 0 to 1 or 1 to 0).
Write program that will ask user how much their purchase was : Write a program that will ask a user how much their purchase was, and then how much money they gave to a sales person.to a sales person.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Implement the linear regression algorithm

Write a C program to implement the linear regression algorithm

  Program that opens a file representing an encoded maze

Write a C++ program that opens a file representing an encoded maze and reads it in properly so it can be analyzed.

  Write a program that will first read in a positive integer

Write a program that will first read in a positive integer number, say n, from standard input. Then you need to create enough space in the heap via a call to malloc to hold an array of n integers.You then need to use array index operators to fill the..

  The private members of yclass are public members of xclass

Suppose that a class employeeType is derived from the class personType. Give examples of data and function members that can be added to the class employeeType.

  Functions to make a main program

write the required functions to make a main program that is already written

  Write the two redox half-reactions

How would I write the two redox half-reactions for these: Ag/Ag+| | H+/H2 Cu/Cu2+| | H+/H2 H2/H+| | Zn2+/Zn

  Write a c program for addition

Write a C Program for addition

  Functionality in the application

When the application starts, it should display a message asking the user to enter either option d or v. The application should execute the following actions for the two options: d: The application should display the file extension of the stock det..

  Read in the interest rate

In C++ Using a while loop, code and run a program that will calculate how long it will take $10,000.00 to become $1,000,000 with 0.08 interest rate.

  Find maximum velocity and maximum acceleration

Find maximum velocity and maximum acceleration - Write a general function that can be used to find the maximum of any array. Call this function twice in order to find maximum velocity and maximum acceleration.

  Implement a solution via semaphores and threads

Implement a solution via semaphores and threads to the n reader 1 writer problem. Fairness always matters. You will accept the number of readers from the command line

  Main program should instantiate an instance

The main program should instantiate an instance of the class Rectangle and then make calls to the member functions to input the data and output the results

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd