Several different formats are used to represent color. For example, the primary format for LCD displays, digital cameras, and web pages—known as the RGB format —specifies the level of red (R), green (G), and blue (B) on an integer scale from 0 to 255. The primary format for publishing books and magazines—known as the CMYK format —specifies the level of cyan (C), magenta (M), yellow (Y), and black (K) on a real scale from 0.0 to 1.0.
Write a program CMYKtoRGB.java that converts from CMYK format to RGB format using these mathematical formulas:
Your program must take four double command-line arguments cyan , magenta , yellow , and black ; compute the corresponding RGB values, each rounded to the nearest integer; and print the RGB values
and then there’s a diarrhea of letters and equals signs and no punctuation in sight.
Where… exactly do the line breaks go in that block? Why are there whites and blacks in there when CMYK and RGB do not feature ‘white’?
What part of the problem are you having trouble with, and what code have you written so far?
I’m guessing this was a table that you tried to copy and paste that wrote something like…
white
red
green
blue
=1-black
=255*white*1-cyan
=255*white*(1−magenta)
=255*white*(1−yellow)
Which would be the standard formulae for converting CMYK to RGB (though most of the time they dont bother defining white, and just say 255*(1-K)*(1-WhateverColor)
So, you’ve got the maths.
You presumably have some basic skill at producing a java script. (Note: Not a JavaScript. As you’re in school, and either will take or have recently taken a standardized test that requires them, an analogy is in order: Java is to JavaScript as pen is to penguin.)
Show us what you’ve done, and we can help you. “Do this for me” is going to get no response.