Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE DO IN C++ Assignment1A: Inverted Color: One of the truly fascinating things about the world is that its infinite. What do we mean by

PLEASE DO IN C++

Assignment1A: Inverted Color: One of the truly fascinating things about the world is that its infinite. What do we mean by this? As an example, we could ask you how many shades of yellow there are, and youd soon realize there are an infinite number of them. Because computers dont 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.0 1.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 Dont worry about handling values outside that range well 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, well 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 (0-255):

101 Enter a green value (0-255): 67

Enter a blue value (0-255): 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning Databases With PostgreSQL From Novice To Professional

Authors: Richard Stones, Neil Matthew

2nd Edition

1590594789, 978-1590594780

More Books

Students also viewed these Databases questions