Travaux dirigés (TD) - Programmation
35 documents à télécharger gratuitement
Travaux dirigés (TD) 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 outlines several programming exercises designed to develop skills in Python programming. The tasks cover various topics such as defining and manipulating variables, detecting vowels and consonants in strings, mathematical computations, conditional logic, and list operations. Special emphasis is given to error handling and edge cases within the context of functions and iterative loops, and the document provides step-by-step instructions for working with calculations, conditional statements, and string/manipulation techniques.
This document contains exercises focusing on electrical measurements, including the characteristics of ammeters and voltmeters. It outlines specific tasks related to calculating multipliers and resistances in various configurations. The exercises are designed to enhance understanding of measurement accuracy and instrument design.
This document presents corrections for exercises in object-oriented design methodologies aimed at second-year undergraduate students. Core activities include modeling multiplicity constraints in various contexts (e.g., rental contracts and vehicles), exploring banking associations with constraints, and handling academic course management. Additional exercises focus on implementing graphical editors and managing IT park resources, demonstrating practical applications of design principles.
This document presents a series of exercises aimed at mastering class diagram modeling. It includes several tasks to analyze relationships and create corresponding class diagrams based on provided scenarios. The exercises cover various contexts in programming and class structures, focusing on practical application in software design.
This document comprises a series of exercises aimed at defining classes and implementing inheritance in C++. It includes tasks related to geometric shapes, articles with discounts, banking account functionalities, and vehicle characteristics. Students are required to apply object-oriented principles to develop solutions to the presented exercises.
This document contains a correction of an object-oriented programming exercise. It discusses interfaces and classes for different types of articles in a store, demonstrating how to manage stock and calculate revenue. Key concepts include inheritance, method overriding, and basic sales functionality.
This document provides solutions to various Java programming exercises related to functions and data structures. It includes the design of functions for numerical operations, array manipulations, and creating classes for student management. The content is aimed at students studying Java programming.
This document provides a comprehensive overview of algorithmic methods used in various mathematical contexts. It covers topics like naive algorithms, binary methods, dynamic programming, and greedy algorithms, along with exercises for practice. The course includes bibliographic references for further reading.
Ce document présente un exercice de gestion des comptes bancaires utilisant la programmation orientée objet en Java. Il traite des différents aspects de la création de comptes et de clients, ainsi que des opérations de crédit et de débit. De plus, il explore la possibilité d'avoir plusieurs comptes par client et inclut des exercices sur les types de comptes et les types de clients.
This document presents a series of exercises focused on temporal logic, specifically linear temporal logic. It includes problems regarding tautologies, descriptions of temporal properties, evaluation of formulas within a transition system, and specifications related to an elevator system. The final exercise involves constructing a Büchi automaton for a specific formula.
The document deals with solving the problem of finding the longest common subsequence (LCS) between two sequences using dynamic programming. It explains the problem formulation, defines a recurrence relation for LCS, and provides a recursive algorithm with exponential time complexity for sequences with no common elements. A more efficient dynamic programming algorithm is presented, which computes the LCS with a time complexity of O(nm). Additionally, the method for extracting the actual LCS string is provided using a traceback table.
This document serves as an exercise-based revision guide to strengthen programming concepts. It discusses exception handling using Java, addressing methods like parseInt and custom exception creation. The exercises focus on implementing and testing custom exceptions in classes like 'Entreprise' and its derivatives, as well as practical usage of the 'Toutou' class constructor with validations. Additionally, it introduces abstract classes with 'TabTrie', discussing inheritance, sorting, and the use of exceptions within data structures.
This document presents exercises focusing on Java programming concepts such as exception handling, class inheritance, and abstraction. The first exercise demonstrates the use of the parseInt method to sum integers from command-line arguments, ignoring non-integer entries. The second exercise involves designing a class hierarchy to handle custom exceptions related to company attributes such as mission and capital. The third exercise focuses on constructors propagating exceptions when incorrect arguments are provided to instances of a 'Dog' class. Lastly, the fourth exercise addresses abstrac...
The document presents a step-by-step practical application of key object-oriented programming principles: encapsulation, inheritance, and polymorphism. In encapsulation, users implement a 'Ville' class with private attributes, public methods, and constructors ensuring valid initialization for inhabitants. In inheritance, a 'Capitale' class extends the 'Ville' class, requiring method overriding and testing of parent-child constructor behavior. The task evolves to include a 'Monde' class that manages city-related objects. Finally, polymorphism is demonstrated by creating a mixed array of citi...
This document discusses a logic programming exercise focused on knowledge extraction using predicate logic. It illustrates the formulation of rules and horn clauses to derive conclusions about happiness based on financial status and family success. The exercise culminates in an attempt to prove the goal of achieving happiness through backward chaining.
This document contains programming-focused exercises related to object-oriented design and practical implementations in C#. The exercises test understanding of class structures, attributes, methods, and inheritance principles through various scenarios. Examples include analyzing class behaviors, implementing symmetry and coordinate systems in classes, and building and sorting pairs through bubble sort algorithms. It emphasizes the practical use of static methods, constructors, and object diagram analysis.
This document contains exercises on pushdown automata and their applications in recognizing specific languages. Each exercise presents a language definition, followed by the proposed automata solutions and analysis of their determinism. The exercises focus on various conditions and properties of languages involving symbols a and b.
This document consists of exercises related to deterministic automata recognizing specific languages over the binary alphabet {0, 1}. Each exercise tasks the reader with providing an automaton for specific criteria on binary strings. The document includes corrected answers for reference.
This document analyzes issues of cohesion and coupling in provided Java code snippets. It suggests solutions for improving code maintainability and reusability through the use of modular methods. The analysis focuses on refactoring code to eliminate global variables and enhance method independence.
This document discusses topological sorting of acyclic directed graphs. It provides algorithms for calculating topological orders and explores their complexities. Practical examples and modifications to existing algorithms are suggested.
This document discusses advanced algorithmic concepts focusing on binary trees and their enumeration. It includes exercises related to the properties and complexities of binary trees and decision trees resulting from comparison sorting algorithms. The text aims to deepen understanding of these fundamental data structures and their associated algorithms.
This document discusses advanced algorithmic techniques through exercises on greedy algorithms and the knapsack problem. It outlines problems such as determining optimal fuel stops for a car journey and maximizing the value of stolen goods under weight constraints. The document also includes the formulation of both a fractional and a 0/1 knapsack problem along with their respective solutions and complexities.
This document outlines a lab assignment focused on finding the longest common subsequence between two sequences. It includes a problem statement, definitions, and a series of tasks to be completed, emphasizing dynamic programming techniques. The assignment also addresses algorithm complexity and methods for constructing the longest common subsequence.
Ce document traite de la recherche de la plus longue sous-séquence commune entre deux séquences. Il présente la problématique, ainsi que des résolutions par programmation dynamique et des algorithmes adaptés. Des exemples et des explications sur la complexité des algorithmes sont également fournis.




















