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

  Creates a bus class

write a program that creates a bus class. create a constructor that initializes the number of passengers and number of seats. declare four objects. use the default copy constructor to initialize two of the objects.

  Create valle products accdb database file

Create a new table named Orders using the table design below. You may create your table in design view or datasheet view. Save the Orders table as Orders Your Name. Define a one-to-many relationship between the Customer table and Orders table. Ri..

  Packets of her favourite washing powder

She want to write a programme to determine which one of the packets is the best buy (most economical). Do the calculations and display which packet for all three packet.

  Lu decomposition with gauss elimination

The LU decomposition with Gauss elimination and what is the physical interpretation of the elements of ? Write C++ programs for steps 2, 3, and 4.

  Write a program that uses 3 input files and 3 output files

write a program that uses 3 input files and 3 output files.

  Write a statement that writes both of their values

Write a statement that writes both of their values to standard output in the format

  Write a program that will calculate the percentage

Write a program that will calculate the percentage wins of a team. The program will input the number of wins and losses that a team acquired during a season. The wins should be input in a parameter-less value returning function that returns the wi..

  If a class is derived protected

If a class is derived protected from a base class, explain how this affects the inheritance of all public, protected, and private members of the base class by the derived class.

  You are to add mean, standard deviation

You are to add mean, standard deviation, and insert in order functionality to your statistics list program. Insert in order means that you will add a function called find_index that will locate the place in the array that a new value should be ins..

  Perimeter of a trapezoid

Write a function in c that will return the perimeter of a trapezoid

  C programs hat print out the max, min, and the average value

Write three C programs that print out the max, min, and the average values of the data file included below. Be sure to include the outputs of the programs in your solutions. Use three data file structures (counter, sentinel, and neither counter/senti..

  Program to implement a user defined function

Write a C++ program that uses user-defined functions to read three integer numbers from the user, compute the summation, difference, and product of these numbers, and print the results on the screen.

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