Travaux pratiques (TP) - Programmation

83 documents à télécharger gratuitement

Travaux pratiques (TP) de programmation, partagés par des étudiants et des enseignants. Thèmes couverts : algorithmique, langage C, Java, Python, POO, structures de données.

POO - Correction du TP 8

This document focuses on abstract classes and interfaces in the context of product management. It implements classes for both discounted and non-discounted products, showcasing polymorphism and inheritance. A main program calculates and identifies the product with the highest total value. Interfaces are then utilized to redefine the product functionality, enhancing flexibility and separation of concerns.

abstract class
interface
inheritance
6p0
Compilation de bibliothèque statique

This document provides a step-by-step guide for compiling a static library in C. It includes the creation of a factorial function implementation and a program to utilize this function. The document also outlines the compilation commands necessary to produce an executable from the static library.

factorielle
bibliothe
quot
4p0
TP4 C# - Déplacement des éléments d’une liste vers une autre liste

This document explains the development of a C# application to handle element transfer between two lists using various user interfaces facilitated by a TabControl component with four TabPages. It offers functionality for single and multiple selections in ListBox and CheckListBox controls, alongside features embracing 'drag-and-drop' capabilities. Buttons are provided to add, remove, clear, and transfer elements between the lists. Key C# properties and methods related to ListBox operations, as well as Drag-and-Drop event handling, are described in the annex for reference.

C#
ListBox
Drag-and-Drop
5p0
Atelier Programmation Objet Avancée

The document serves as a step-by-step practical guide for working with Java collections, including ArrayLists, Vectors, LinkedLists, and HashMaps. Each section provides instructions for creating and manipulating data structures, such as adding elements, iterating, sorting, and using specialized methods like addFirst and addLast for linked lists. Additionally, the HashMap section introduces key-value pair manipulation and search techniques, emphasizing systematic output for observation. Overall, the methodology highlights iterative and customizable development practices for advanced object-o...

Java collections
ArrayList
LinkedList
Institut Supérieur des Études Technologiques1p0
POO – Classes Abstraites et Interfaces

This document introduces the concepts of abstract classes and interfaces as core components of object-oriented programming. The methodology includes an explanation of syntax, rules, and practical applications of abstract classes and interfaces. Abstract classes are designed to serve as base classes, providing structure for derivative implementations. Interfaces allow multiple inheritance-like behavior by enabling the implementation of common method signatures without imposing specific inheritance structures. Examples illustrate abstract methods, interfaces with constants, and conflict resol...

abstract class
interface
inheritance
8p0
TP JAVA N°2

The document provides a programming exercise in Java for students studying Object-Oriented Programming. The primary tasks include implementing and testing a class to process arrays and compute various operations such as sums, averages, and search functions. Additional exercises cover writing a method to identify palindromes and implementing a string manipulation class with functionalities like counting words, categorizing vowels and consonants, and extracting numeric characters. The solutions include method definitions and a main method for testing purposes.

Java
ParcoursTableau
palindrome
4p0
TP JAVA N°1 - Programmation Orientée Objet

This document outlines a practical exercise for students in the context of Object-Oriented Programming. It includes three main tasks: defining a class capable of creating and managing integer arrays, implementing a sorting mechanism for these arrays, and applying this functionality through a predefined program stub. The methodology emphasizes coding and object-oriented principles, such as encapsulation and modularity. Results are generated by creating, sorting, and displaying integer arrays using Java code.

Java
Object-Oriented Programming
array sorting
1p0
TP JAVA N°1

This document is a Java programming lab assignment designed for SI2-B gTP2 students at Université de Carthage, specifically for Object-Oriented Programming. It includes a series of exercises focusing on Java classes, methods, and basic object-oriented paradigms. Exercises involve analyzing a given program, implementing classes with constructors and methods, such as for 'Temps' and 'Point', and performing operations like translations, distance calculations, and evaluating program outputs. The final exercise involves creating a program to calculate the area and perimeter of a square using use...

Object-Oriented Programming
Java
class methods
2p0
Encapsulation et concepts de POO - TP4

This document delves into the implementation of Java classes to model bank accounts, focusing on key object-oriented programming principles such as encapsulation, accessors, and mutators. It mandates creating a `Compte` class with attributes, constructors, methods for crediting, debiting, and transferring funds, alongside rules for overdraft and maximum debit limits. The tasks include implementing private attributes, defining methods for account management, and creating a `TestCompte` class to validate functionality. The primary focus is on reinforcing conceptual understanding of OOP while...

encapsulation
toString
object-oriented programming
3p0
Java Practical Work

This document provides a series of Java practical exercises designed to familiarize students with key programming concepts such as object-oriented programming, inheritance, and interfaces. It includes exercises to create and manipulate classes like 'Date', 'Point', 'TableauTrie', and 'Coordonnees', encouraging encapsulation and method implementation. The methodology incorporates practical testing within Java environments, focusing on hands-on coding tasks. Various core aspects of Java including exception handling, polymorphism, and abstract classes are covered in these exercises.

Java
Date class
Object-oriented programming
27p0
TP POO - Séance 03

This document serves as lecture notes for object-oriented programming, focusing on the concepts of variables, methods, and object manipulation through practical exercises. It introduces foundational concepts such as instance variables, class variables, and local variables alongside constructors and methods for object creation, data access, and management. Practical tasks guide readers through the creation of classes and methods to represent and manipulate points on a Cartesian plane and implement address books in programming. Exercises require basic functionality expansions, including const...

variables
constructors
methods
20p0
COMPTE RENDU DES TRAVAUX PRATIQUES

This document presents a lab report on Java RMI programming, including the implementation of remote methods for mathematical calculations. It covers the creation of server and client classes, compilation steps, and execution instructions. Additionally, it outlines exercises focusing on various Java RMI concepts and practices.

java
quot
fichier
9p0
Compte rendu TP JAVA/RMI

This document provides a detailed account of a JAVA/RMI lab exercise conducted by students. It covers the implementation and testing of various Java classes related to remote method invocation. Additionally, it includes steps for server and client setup as well as object factory implementation.

java
client
fichier
26p0
Compte rendu TP JAVA/RMI

This document reports on a lab exercise focused on Java RMI. It includes multiple exercises requiring the implementation and testing of RMI components such as client and server applications. The final sections cover code examples and testing instructions.

java
question
serveur
14p0
TP1: 1ère Application .NET avec C#

This document outlines the process of developing a Windows Forms application in Visual Studio 2010 using C#. It introduces key concepts like projects and solutions, as well as the interface elements within the Visual Studio environment. The tutorial provides a step-by-step guide to building a simple calculator application, covering user interface design, properties configuration, and event-driven coding for arithmetic button functionality. Additional features like interfacing with multiple forms and debugging techniques are also highlighted.

C#
.NET
Visual Studio 2010
8p0
TP2 : Réalisation d’une Facture

This practical exercise involves designing an interface for a billing system, processing product data to compute line item totals, and determining the total amount, discount, and net payable. Key components use TextBox controls for data input, Buttons to trigger calculations, and a Timer control to display the current date and time dynamically. The task requires implementing conditional logic for the discount calculation and handling KeyPress events to automate focus changes between controls during user interaction.

arithmetic operators
KeyPress event
Timer control
3p0
Programmation Web 2 - TP1 : Rappel sur les cadres

This document is a practical lab assignment for creating a small website by utilizing different web techniques. It is divided into three parts, starting with the use of framesets, followed by <div> tags and stylesheets, and finally leveraging features from HTML5 and CSS3. The assignment includes creating a multi-page website with specific layout requirements, such as individual pages for header (entete.html), menu (menu.html), content (contenu.html), and footer (footer.html), which are combined in a main index.html page using framesets for layout definition. Detailed visual and structural r...

Frameset
HTML5
CSS3
Institut Supérieur des Études Technologiques3p0
TP4 - IPC- Moniteur, Signaux et Pipe

This document outlines a lab exercise focused on inter-process communication and synchronization using monitors. It includes various exercises that implement solutions to problems such as readers-writers and philosophers. The aim is to demonstrate the application of monitors and IPC in managing resource access among multiple processes.

processus
fils
signal
7p0
TP 2 - Synchronisation de Threads

This document outlines a lab exercise focused on multi-threading in the context of managing students in a classroom setting. It discusses the implementation of an algorithm for synchronizing multiple student threads with a teacher thread. The task is to complete a provided function related to student thread behavior.

thread
threads
etudiants
8p0
String Manipulation Methods in JavaScript

This document provides an overview of various string manipulation methods available in JavaScript, including indexOf, lastIndexOf, charAt, and several others. Each method is illustrated with examples to demonstrate its functionality. Understanding these methods is crucial for effective string handling in programming.

quot
chaine
chai
2p0
Correction TP 6 - Les listes chaînées

This document explores key concepts and implementations of linked lists in C. It includes several exercises with corresponding code snippets to create, display, modify, and calculate properties of linked lists. Topics such as stack management using linked lists, insertion, deletion, reversed list generation, and list manipulations such as square values are discussed. The exercises aim to strengthen understanding of dynamic memory allocation, pointers, and data structure operations in C.

linked list
memory allocation
C programming
8p0
TP 6: Héritage, Polymorphisme

The document outlines a programming exercise for managing a library system using object-oriented programming principles, including inheritance and polymorphism. Key classes such as 'Ouvrage', 'Livre', 'Video', and 'Bibliotheque' are identified and described with corresponding attributes and methods. The functionality includes adding unique works to the library, retrieving specific works, and displaying library contents. A test class demonstrates the implementation and behavior of the system, including scenarios for book availability and polymorphic behavior through the 'affiche' method.

Inheritance
Polymorphism
Ouvrage
Faculté des Sciences de Bizerte1p0
UNIVERSITE DE CARTHAGE - TP5: Les Tableaux et les chaînes de caractères

This document outlines two exercises focusing on object-oriented programming concepts in Java. Exercise 1 involves creating a 'TableauTrie' class to manage a sorted array of integers with methods for insertion, deletion, search, and display, along with an accompanying test class 'TestTableauTrie'. Exercise 2 requires the implementation of a 'Decouper' class for tokenizing text based on specified delimiters, with a test class 'TestDecouper' provided. Core functionalities like handling data structures, employing loops, and method writing are emphasized. The exercises demonstrate OOP principle...

TableauTrie
Decouper
Object-Oriented Programming
Faculté des Sciences de Bizerte2p0
TP4: Complément sur les Objets et les Classes

This document outlines a practical assignment focused on creating and manipulating student entities using object-oriented programming. It involves defining a `Student` class with private attributes such as name, age, and average score, along with methods like comparing averages and displaying student data. The assignment also requires creating a `TestStudent` class to instantiate objects, compare their attributes, and demonstrate updates to their values. Students are prompted to refactor the code by removing specific methods and handling comparisons directly in the `main` method.

Student class
average score comparison
object-oriented programming
Faculté des Sciences de Bizerte1p0

Autres ressources en programmation