Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PLEASE ANSWER IN JAVA Assignment1A: Inverted Color: One of the truly fascinating things about the world is that it's infinite. What do we mean by
PLEASE ANSWER IN JAVA
Assignment1A: Inverted Color: One of the truly fascinating things about the world is that it's infinite. What do we mean by this? As an example, we could ask you how many shades of yellow there are, and you'd soon realize there are an infinite number of them. Because computers don't have an infinite amount of storage space, they have to approximate the natural world. For colors, they most often use an additive color model comprised of (R)ed, (G)reen and (B)lue. They store these values either as a floating point number 0.01.0 (fully off to fully on), or an integer between 0 to 255 . Many art programs have a tool or filter called "Invert Color" which converts the on-screen colors and gives you their opposite. For example, a pure red (255,0,0) becomes a bright blue ( 0,255,255). You will create a program that calculates an inverted color based on what the user enters. Your task is to: a) Ask the user to individually enter in three values between 0 to 255 b) Read those three values in Don't worry about handling values outside that range - we'll learn how to do that later in the semester c) Invert each number d) Display the results e) Convert the inverted colors to floating point numbers f) Display those results You do not need to match the number of decimals precisely, as long as the answer is correct. Again, we'll learn how to do that later. The algorithm output is as shown below, with user input in bold. Save your source code in a file called Assignment1A (with a file extension of .cpp, .cs or .java) Sample Output: Enter a red value (0255) : 101 Enter a green value (0255):67 Enter a blue value (0255):33 The inverted color is red=154, green =188, blue =222 With floating points, that would be red=0.6039, green=0.7373, blue =0.8706
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started