Register  |  Login




Advertisement

Start Your Own Q&A Site

Create your own Q&A site easily, allowing you to quickly grow a new community around any subject matter or generate new organic traffic for your existing website.

Question

Status: Closed Points: 75 Time: 06:23 - Aug 24, 2006  

multani.sarbjit

OOPS based question of University

Define a set of classes and methods to model these entities:
- a Light that you can turn on and off
- a Light that you can turn on and off and also set to a specific light level e.g. 50% brightness.
- a Scene which contains a number of Lights, with a level specified for each Light
o a Scene can be turned on or off
o Lights can be in multiple Scenes
o A Light is only turned off if all Scenes that it is part of are off

In our scenario we have 2 Scenes (A and B).
Scene A
- Lights 1 (on), 2 (on), and 3 (50%).

Scene B
- Lights 3 (70%), 4 (on), and 5 (on)

Write some client code that will create the objects to model our 2 Scenes, turn on both scenes, then turn off Scene B. Please show the implementation that will allow Light 3 to stay on after Scene B is turned off.



Sample answer :

Scene pSceneA, pSceneB;
pSceneA = new Scene
pSceneB = new Scene

pSceneA.AddLight( new Light(“1”), 100 )
pSceneA.AddLight( new Light(“2”), 100 )
pSceneA.AddLight( new Light(“3”), 50 )

pSceneB.AddLight( new Light(“3”), 70 )
pSceneB.AddLight( new Light(“4”), 100 )
pSceneB.AddLight( new Light(“5”), 100 )


pSceneA.On()
pSceneB.On()
pSceneB.Off()



any solution please!!!!

Categories

Answer Discussion
Tutorials

 

admin

Date:: Aug 22, 2007

Time:: 20:17

multani.sarbjit, did you get your question solved?

If you did then please close this question and distribute the points. If you found the solution on your own, we would be very happy if you could explain it here for the sake other users having the same problem.

If you didn't get a solution to your problem, please leave a comment here to let the experts know that you're still looking for an answer.

Thanks,
The Quomon Admin Team

multani.sarbjit

Date:: Sep 14, 2007

Time:: 00:11

Admin,

Thanks for the remainder.

Question Answered

This question has been closed, and points have been rewarded to the following experts:


multani.sarbjit: 75

You're welcome however to comment or give additional information or if you wish, you have the ability to write a Tutorial in the Tutorial Area.

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

No tutorials have been submitted yet. Want to be the first?

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

Ask a Question

Have a new question? Ask!

You have 100 characters to use



Top Experts

View More

Rank

Expert

Points

1.

nidhi

10279

2.

oracleofDelphi

6493

3.

rcastagna

5596

4.

LAGM

4848

5.

PeterNZ

3487

6.

gonzalo

2840

7.

Mason

2770

8.

jgivoni

2303

9.

xarcus

1820

10.

Anpanman

917

Become an Expert

Register today to share your knowledge with the community and be recognized and rewarded for your contributions.


Register Here




"Psst, Quomon is a great site. Pass it on."     Tell a Friend  |   Link To Us  |   Save to Delicious  |   Digg! Digg it



Language Options

English:

www.quomon.com

Español:

www.quomon.es