0% found this document useful (0 votes)
6 views

New Lab 6

Uploaded by

finconnu6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

New Lab 6

Uploaded by

finconnu6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Object Oriented Programming 1

Engineering track / 2nd year


2024-2025

Lab # 6: Messages and communication between objects (1)

Statement

Exercise 1

Knowing that class A is installed in the dir1 assembly, itself installed in the dir assembly, what is the full
name to give to A ?

Exercise 2

Consider the following two classes: Switch and Lamp, such that when the switch is turned on, the lamp
lights up immediately. Create in a pseudo-object code the small program allowing this interaction.

Exercise 3

Write a minimal code that cascades messages between three objects.

Exercise 4

Consider the two classes Mouse and Window, such that when the mouse clicks on a specific point in
the window, it closes. Create pseudo-object code allowing this interaction. We will favor a
“dependency” type relationship between the objects concerned.

Exercise 5

Write code for a class that sends a message to itself, first when that message involves only one object,
then when that message involves two.

You might also like