Python Exercise with object-oriented code and design patterns

Clear, simple and elegant object-oriented code is important. Avoid the minimum possible solution; Consider maintainability and extensibility by the demonstration of appropriate abstractions. A solution using the fewest possible lines of code is not the best option.

Part 1. Visitor

Create an interface or abstract base class 'Shape'.

Implement three concrete Shapes: 'Circle', 'Rectangle', 'Triangle'.

Apply the visitor pattern to your data model.

Write an AreaVisitor that computes the area of the shapes.

Write a program that makes arbitrary instances of the data model and applies the AreaVisitor.

Part 2. Multi Power Point

A power switch is required that can turn on or off any number of appliances. An appliance is for example a Blender, a Toaster, or an Oven.

Other programmers have already written those appliances and you can't change their source code (e.g. to require them all to implement a particular interface), or extend from those classes.

Fortunately, each such appliance already has two methods to turn its particular appliance on and off. Unfortunately, all such methods were written by different people and have different names (examples: [url removed, login to view](), [url removed, login to view](), [url removed, login to view]()).

Write three third party appliances and put them in a separate package. It should be visible from the output of each appliance whether it is turned on or off (in its third-party vocabulary).

Make a representation of a Multi Power Point. You can plug in as many appliances as you wish and turn them on and off all at once, by turning the multi power point on() and off(). Consider how you would model a real multi power point and make appropriate design choices.

Write a program that demonstrates your Multi Power Point​.

Part 3. Paper Scissors Rock

Paper Scissors Rock is a game for two players. Each player simultaneously opens his/her hand to display a symbol:

Fist equals rock,

Open hand equals paper,

Showing the index and middle finger equals scissors.

The winner is determined by the following schema:

paper beats (wraps) rock,

rock beats (blunts) scissors,

scissors beats (cuts) paper.

Write a program that plays Paper Scissors Rock between the computer and a real player.

You should be able to play the game n times before the program exits.

Good option is to generalize from these requirements to demonstrate clear, maintainable and extensible code.

Compétences : Python

en voir plus : strategy design pattern java code example, python design patterns, object oriented programming in python, object oriented design patterns, design patterns elements of reusable object oriented software pdf, object oriented design patterns codeigniter, design pattern android code, python workflow design pattern, code hangman game object oriented programming, using design pattern code igniter, different types design patterns dot net, web2 design html code, website design zip code, j2ee spring design pattern, design pattern vrp problems, design patterns car insurance project, spring jms integration design pattern, data import design patterns, ebay listing design html code, design pattern developing game php, service provider design pattern telecommunication, jsf web design patterns, eclipse update site j2ee design patterns, sofa design pattern flash seo, javajspjdbc javascript css design patterns mvc spring

Concernant l'employeur :
( 1 commentaire ) Malaga, Spain

Nº du projet : #14070797

Décerné à:


Sure, it sounds good. I am expert on Python. I am post-doc researcher at university in PAris. I can write this program easly.

%selectedBids___i_sum_sub_4% %project_currencyDetails_sign_sub_5% EUR en 1 jour
(0 Commentaires)

7 freelance font une offre moyenne de €49 pour ce travail


Greetings sir, i am an expert freelancer for this job and your 100% satisfaction is assured if you allow me to serve. Here is the reason. Why you should pick me? a) I am a very expert and have the same kind of ex Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% EUR en 1 jour
(4 Commentaires)
%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% EUR en 3 jours
(3 Commentaires)

Dear Hiring Manager, here's our official site please have a look [login to view URL] Thank you for this wonderful opportunity. Today Your job posting has caught my attention because I’m a looking for Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% EUR en 1 jour
(0 Commentaires)
%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% EUR en 3 jours
(0 Commentaires)

Hey client, I am a professional developer having a great passion for programming. I have good concepts about design pattern with industry [login to view URL] for your reply.

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% EUR en 1 jour
(0 Commentaires)

Hey there, I have understood the problem statements mentioned by you. I can do this in 2 days time. Regards Ankit

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% EUR en 1 jour
(0 Commentaires)

I believe that this project is suitable for me because u have the required skillset to complete the given task

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% EUR en 1 jour
(0 Commentaires)