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

Assignment 2

This document provides a class diagram scenario to test method calls between different classes. It includes 14 classes related to buildings and businesses. Students are to write Python code for the classes and test which methods can be called between classes by putting ticks in a grid. The purpose is to check method calls and understand relationships between classes.

Uploaded by

bsmt22098
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Assignment 2

This document provides a class diagram scenario to test method calls between different classes. It includes 14 classes related to buildings and businesses. Students are to write Python code for the classes and test which methods can be called between classes by putting ticks in a grid. The purpose is to check method calls and understand relationships between classes.

Uploaded by

bsmt22098
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Assignment 2

Here’s a scenario with different classes in this class diagram below.

1. You’ve to write code in Python to make all these classes as per their specification and relationships in the diagram.
2. In the functinos/behavior in each class, just print a message, for example if you call shop.sell(), it prints “Shop Sells”. That’s it
3. Now you’ve to check which method can be called in which classes and why?

This grid will help you decide. Call all these combinations and put a tick in the gird below, everytime you don’t get an error.

Build() Construct() Create() Raise() Sell() Feed() Play() Reside() Livein() Cure() Teach() Enlighten() Retail() Vend() Trade() Merchandise()
Building
Commercial
Building
Residential
Biulding
Service
Building
Shop
Restaurant
Cinema
Flats
House
Hospital
School
Mosque
Store
Grocery
Store
Organic
Store
Vegetable
STore
Building

Build()
Behavior 2

Commercial Building Residential Building Service Building

Construct() Create() Raise()


Behavior 2 Behavior 2 Behavior 2

Shop Restaurant Cinema House


Flats School Mosque
Hospital

Sell() Feed() Play() Livein()


Reside() Teach() Enlighten()
Behavi Behavior 2 Behavior Cure()
Behavior Behavior Behavior
Behavior Behavior 2

Store Grocery Store Organic Store Vegetable Store

Vend() Trade() Merchandise()


Retail()
Behavi Behavior 2 Behavior 2 Behavior 2

You might also like