id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

tmhscs@gmail.com competition > HPCW2020_07_ColorMixer
prev  |  next  |  chance

Color Mixer
Problem 07
Worth 4 points

ROYGBIV isn't just an acronym, it's a way of life for your paint company. The owner is considering modernizing
her paint mixing equipment with a computerized model. She's hired you to code the prototype. Your simple
program will need to correctly output the right color based on the blends she's given you.

INPUT:
You will receive a color combination consisting of primary colors and secondary colors as well as black and white
to make "dark" and "light" colors. The full science of colorization and pigments will be
implemented next, if your prototype is successful.

OUTPUT:
Your program should output the correct color depending on what two colors were "mixed" on the line. Primary
colors should mix together to create secondary colors. Anything mixed with "WHITE" or "BLACK" should be
output as either "LIGHT X" or "DARK X" where X is the color "WHITE" or "BLACK" were mixed with. Anything
mixed with itself won't change colors. You are guaranteed not to receive incompatible colors, or colors not
listed in the color wheels shown above (aside from "WHITE" and "BLACK").

HPCW2020_07_ColorMixer("Red Yellow") → "Orange"
HPCW2020_07_ColorMixer("Blue White") → "Light Blue"
HPCW2020_07_ColorMixer("Yellow Yellow") → "Yellow"

...Save, Compile, Run (ctrl-enter)

public String HPCW2020_07_ColorMixer(String colors) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Post-solution available

Copyright Nick Parlante 2017 - privacy