100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

Object-Oriented Programming in Python

Rating
-
Sold
-
Pages
4
Grade
B
Uploaded on
03-05-2023
Written in
2022/2023

Object-Oriented Programming (OOP) is a powerful programming paradigm that allows you to organize your code into objects that have properties and methods. This course is designed for intermediate-level Python programmers who want to learn how to use OOP concepts in Python. Throughout this course, you will learn the core principles of OOP, such as encapsulation, inheritance, and polymorphism, and how to apply them in Python. You will also learn how to create classes and objects, define attributes and methods, and use inheritance to create new classes based on existing ones. By the end of this course, you will have a solid understanding of OOP concepts in Python and be able to design and implement object-oriented programs to solve complex problems. You will also be ready to explore more advanced topics in OOP and Python, such as design patterns and GUI programming. Course Outline: Introduction to OOP What is OOP? Advantages of OOP Core principles of OOP OOP in Python Classes and Objects Defining classes and objects Instance variables and methods Constructors and destructors Class variables and methods Encapsulation and Abstraction Encapsulation in Python Access modifiers Abstraction in Python Inheritance Inheritance in Python Single and multiple inheritance Method resolution order (MRO) Abstract classes and interfaces Polymorphism Polymorphism in Python Method overriding and overloading Duck typing Exception Handling in OOP Exceptions in Python Raising and catching exceptions Custom exceptions Advanced OOP Concepts Design patterns in Python Decorators and descriptors Metaclasses Garbage collection Prerequisites: To take this course, you should have a solid understanding of basic Python programming concepts such as variables, data types, conditional statements, loops, functions, and modules. You should also be familiar with object-oriented programming concepts such as classes, objects, inheritance, and polymorphism. If you are new to OOP, we recommend taking an introductory Python course or reading an OOP textbook before taking this course.

Show more Read less








Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
May 3, 2023
Number of pages
4
Written in
2022/2023
Type
Exam (elaborations)
Contains
Only questions

Content preview

POO TDD 101.102.103




POO_TP N° 1
Objet, Classe, Surcharge, Constructeur, Destructeur
Objectifs :
Définir les propriétés et méthodes d’une classe
Créer une instance de classe
Accéder par les accesseurs aux propriétés en lecture et écriture d’un objet Appliquer
des méthodes
Définir des constructeurs
Apprendre à surcharger une méthode.


Travail demandé :
Exercice 1 :
1) Créer une classe Python nommée CompteBancaire qui représente un compte bancaire, ayant pour
attributs : numeroCompte (type numérique ) , nom (nom du propriétaire du compte du type chaine),
solde.
2) Créer un constructeur ayant comme paramètres : numeroCompte, nom, solde.
3) Créer une méthode Versement() qui gère les versements.
4) Créer une méthode Retrait() qui gère les retraits.
5) Créer une méthode Agios() permettant d'appliquer les agios à un pourcentage de 5 % du solde
Créer une méthode afficher() permettant d’afficher les détails sur le compte
6) Donner le code complet de la classe CompteBancaire.
7)

Exercice 2 :
1) Définir une classe Employé caractérisée par les attributs
:Matricule, Nom, Prénom, DateNaissance, DateEmbauche, Salaire.
2) Définir un constructeur permettant d’initialiser les attributs de la méthode par des
valeurs saisies par l’utilisateur.
3) Ajouter à la classe la méthode Age( ) qui retourne l’âge de l’employé.
4) Ajouter à la classe la méthode Anciennete( ) qui retourne le nombre d’années
d’ancienneté de l’employé.
5) Ajouter à la classe la méthode AugmentationDuSalaire( ) qui augmente le salaire de
l’employé en prenant en considération l’ancienneté.
- Si Ancienneté < 5 ans, alors on ajoute 2%.
- Si Ancienneté < 10 ans, alors on ajoute 5%.
- Sinon, on ajoute 10%.
6) Ajouter la méthode AfficherEmployé() qui affiche les informations de l’employé comme
suit :
- Matricule : […]
- Nom complet : [NOM Prénom]
- Age : […]
- Ancienneté : […]
- Salaire : […]
7) Ecrire un programme de test pour la classe Employé.




1/4 2022 /2023
£5.77
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
lahcenzizox

Get to know the seller

Seller avatar
lahcenzizox University of Ulster (London)
View profile
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
2 year
Number of followers
0
Documents
2
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions