Travaux pratiques (TP) - Programmation
91 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.
This document serves as a guide for an introductory workshop aimed at familiarizing learners with Java EE technology and the MVC design framework. It begins by explaining Java EE, its purpose, and how it supports robust and distributed web application development. The functioning of client-server communication via HTTP is dissected, alongside the role of application servers like Apache Tomcat in handling requests and responses. Finally, the document outlines the MVC (Model-View-Controller) design pattern, detailing its components and their roles in enhancing modularity, collaboration, and m...
This document provides exercises related to abstract classes and interfaces in Java, demonstrating the implementation of inheritance and polymorphism. Key methodologies include abstract class creation, the use of interfaces, and the differentiation between non-discounted and discounted products through specialized constructors and methods. The findings showcase the calculation of product prices and selection based on maximum price logic, integrating both abstract methods from classes and interface implementations. Examples are executed via a `main` method to test the functionalities.
This document emphasizes the application of inheritance and polymorphism principles in object-oriented programming using Java. It outlines the design and implementation of multiple classes representing various library documents, with Document as a superclass and specific subclasses such as Livre, Roman, Manuel, Revue, and Dictionnaire. It demonstrates key features like method overriding, accessor methods, and constructors, while also detailing test scenarios to validate the functionality via various interactions. This practical exercise culminates in implementing specialized library classes...
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.
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.
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.
This document explores exception handling and abstract classes in Java through exercises and detailed code examples. It demonstrates practical implementation of exception propagation, custom exceptions, constructors with exceptions, and the `finally` clause. Abstract classes are utilized to design a sorted object structure, comparing their usage with interfaces. Key findings include the role of `finally` in exception control flow and the power of abstraction for structured problem-solving.
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...
This document introduces abstract classes and interfaces as fundamental concepts in object-oriented programming. The methodology involves defining abstract classes that cannot be instantiated but serve as base classes for derived classes, which implement abstract methods. Interfaces are presented as constructs defining only method signatures and constants, enabling multiple inheritance and inter-class interaction. Practical examples illustrate syntax, implementation, and the functional importance of both constructs in software development.
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...
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.
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.
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...
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...
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.
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...
This document contains correction elements for TP 4 focused on AWK and SED programming exercises. It includes various examples and explanations for using AWK and SED commands effectively. Each exercise addresses different scenarios to strengthen understanding of text processing in Unix-like environments.
This document contains a report on practical work related to Java Remote Method Invocation (RMI). It includes various programming exercises and implementations of remote interfaces. The students Amani BEN DHIAB and Mohamed Yassine CHAIEB conducted the exercises under the guidance of Mme. Nadia BEN AZZOUNA during the academic year 2012-2013.
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.
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.
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.
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.
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.
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...















