Question: Program - Write a Java program that computes a CSS color. We define a CSS color as a string that starts with a # character
Program Write a Java program that computes a CSS color. We define a CSS color as a string that starts with a # character and it is followed by three pairs of characters. The possible pairs of two characters will be or FF A color is defined by two characters for red, two characters for green, and two characters for blue. For example, #FF is just red, whereas #FFFF is the combination of green and blue. Your program will ask users whether they want to have red as part of the CSS color. If the user answers "Yes", FF will be used for the red component; otherwise will used. The program will then ask the user whether they want both green and blue in the CSS color. If the user answers"Yes", FFFF will be used for green and blue; otherwise will be used. As you can see not all possible color choices can be generated eg #FOOFF The following are examples of running the program. The examples illustrate the messages to use when reading data and displaying the result. Notice that in addition to use "Yes", users can use "Yeah" to accept a choice. Any other value entered is considered a No answer.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
