Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

computer graphics, a light can be represented as a mixture of the three colors, red, green Light will be 10 and blue. We will use

image text in transcribed
computer graphics, a light can be represented as a mixture of the three colors, red, green Light will be 10 and blue. We will use a colors in a Light. The level of each of the three colors may vary between o 255, and a of the form: (r, g.b). Wnite complete interface and implementation code for the class Light 1. The Light is represented by three values: the value for red, green and blue 2. Three constructors. A default constructor that takes no arguments. A constructor that takes three triple of three integer values to represent the level of each of these three values with 2 default parameters. A copy constructor 3. An assignment operator- function. 4. A friend binary addition operator+ function. To add two Lights add red to red, blue to blue and green to green 5. An insertion operatorce function. 6. A member function operator- retuns true if two Lights are equal, false otherwise 7. A member function calfled White that returns a Boolean, true if the Light is white, false otherwise. A Light is white if the three values are: whito (ss, 255, 255) Pass parameters as const and reference when appropriate. You must decide what built-in type or types you will need as private data members. Do not use any more space than is needed to store the needed values. If a function may be declared as const, do so. Do not implement within the Your implementation of this class must ensure that objects of type Light are always in a correct state. class

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

JDBC Database Programming With J2ee

Authors: Art Taylor

1st Edition

0130453234, 978-0130453235

More Books

Students also viewed these Databases questions