Exercices - Programmation

86 documents à télécharger gratuitement

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

Java Object-Oriented Programming Exercise

This document contains exercises for a lab focused on Object-Oriented Programming in Java. Students will create classes representing polygons and geometric shapes, implement methods for calculations and comparisons, and utilize polymorphism through method overriding. The exercises aim to solidify understanding of class design and object manipulation in Java.

thode
classe
cercle
3p0
Fiche Exercices POO- JAVA UEO55.1

This document contains exercises related to object-oriented programming principles in Java, focusing on class visibility, class relationships, code analysis, concepts of inheritance, generics, and cloning. It presents various coding scenarios and questions that assess understanding of the Java language and object-oriented design.

public
classe
points
12p0
Corrigés des premiers exercices sur les classes

Ce document présente des exercices corrigés sur l'utilisation de classes en Java. Il explique la création d'un compte bancaire, des opérations y afférentes, ainsi que l'implémentation de diverses méthodes. L'exécution de programmes est également démontrée à travers des exemples concrets.

compte
quot
solde
2p0
Programmation Orientée Objets et Evénementielle

The document details an exam on Object-Oriented Programming using Java, focusing on class hierarchy, inheritance, and polymorphism. It presents exercises analyzing a Java program that involves classes for books, comics, and coloring albums. Additionally, it includes questions regarding class attributes and functionality.

quot
classe
afficher
7p0
Modélisation Dynamique

Ce document traite de la modélisation dynamique à travers divers exercices. L'Exercice 1 porte sur un guichet automatique de banque, tandis que l'Exercice 2 concerne un système de réservation de billets de train. L'Exercice 3 implique la conception d'un logiciel de gestion pour un club sportif, en se concentrant sur l'inscription des membres aux cours privés.

syste
mode
inscription
École Nationale des Sciences de l'Informatique (ENSI)4p0
Priority Queue and Traffic Simulation Exercises using Java

The document discusses the implementation of data structures and simulations using Java programming. The first exercise focuses on developing a generic priority queue system (class FilePrio) that manages information based on given priority levels, incorporating methods to add, fetch, and query information. The second exercise extends the concept to simulate traffic at a four-way intersection (class Carrefour) using a priority system for vehicles, with ambulances prioritized over cars and each type governed by specific queues. These implementations serve as demonstrations of object-oriented...

priority queue
FilePrio
Carrefour
1p0
Implementation and Simulation of Priority Queues and Traffic Systems in Java

The document introduces the concept of priority queues and their implementation in Java via the 'FilePrio' class, which supports generic storage and three primary methods: entering, retrieving, and consulting information based on priority. A secondary problem simulates traffic management at a four-street intersection using the 'Carrefour' class, prioritizing ambulances over cars and ordering cars based on defined street hierarchies. Both tasks demonstrate the utilization of priority queues to handle real-world scenarios of data prioritization and resource management effectively.

priority queue
FilePrio class
Carrefour class
1p0
MMaattiièèrree PPrrooggrraammmmaattiioonn OOrriieennttééee OObbjjeett

This document presents exercises focused on Object-Oriented Programming concepts in Java, specifically classes and objects. It includes the implementation of a 'Point' class, a 'Personne' class, and a 'Date' class, with detailed methods and constructors. The exercises are designed for second-year students and aim to solidify their understanding of object instantiation and data representation.

personne
quot
date
4p0
Systèmes d’Exploitation & Programmation Concurrente

This document contains an exam issued by the Ecole Nationale des Sciences de l’Informatique for the 2018/2019 academic year focused on operating systems and concurrent programming. It includes various exercises covering process creation, concurrency issues, and synchronization techniques, encouraging clear and concise responses. The exam aims to assess students' understanding of key concepts in concurrent processing and synchronization mechanisms.

processus
priorite
temps
8p0
Des maths avec Python

Ce document présente des méthodes numériques pour trouver les zéros d'une fonction, en mettant l'accent sur les méthodes de recoupement par intervalles, de dichotomie et de regula falsi. Il fournit des exercices pratiques pour mettre en œuvre ces méthodes à l'aide de Python. L'auteur aborde également la difficulté de résoudre certaines équations polynomiales algébriquement.

fonction
thode
exercice
9p0
2BPmicro Programmation Fraisage CN - Exercice N°4

This document provides detailed instructions for a CNC milling exercise, focusing on contouring, spotting, and drilling tasks. It outlines the tools used, including a T1 end mill and T2/T3 drill bits, along with precise cutting conditions like spindle speed (N) and feed rate (Vf). Key points and tool corrections are specified for each step, with precise coordinates and G-code commands for execution. The document concludes with a program for CNC contournage, spotting, and drilling, ensuring accuracy and adherence to prescribed conditions.

CNC programming
cutting conditions
contouring
2p0
Programmation Fraisage CN Exercice N°3

This document is an instructional exercise focused on CNC milling programming that involves contouring with and without radius correction, using a 5mm diameter cutting tool. Methodologies include decoding program instructions, completing coordinate tables, and visualizing milling paths. The document describes step-by-step machine tool movements, including tool mounting, rapid positioning, and precise milling operations. Key findings emphasize accuracy in dimensional placements and the use of G41 for radius correction to improve precision in machining paths.

CNC programming
G41 radius correction
tool path visualization
3p0
Programming Exercises in Java

The document provides multiple Java programming exercises focused on creating GUI applications to compute the area and perimeter of a rectangle and manipulate list selections. It details implementations such as using Swing components for user input validation, button interactions, and dynamic menu-driven options for computations. The solutions emphasize event handling and input validation. Furthermore, it introduces list-based GUI displays with actions triggered by selections, showcasing practical examples of Java development for beginners.

GUI development
Rectangle computations
Swing Framework
Institut Supérieur des Études Technologiques9p0
Les interfaces graphiques en Java

This document explores GUI design in Java through three exercises focusing on calculating rectangle properties, dynamically updating UI elements based on user input, and implementing a menu for calculations. The first exercise involves writing a program to calculate surface area and perimeter with input validation. The second exercise develops a window with interactive list-based buttons for programming language selection, offering two update mechanisms. The third exercise creates a menu-based UI for entering rectangle dimensions and performing calculations, featuring user-friendly input bo...

Java
Rectangle calculations
Graphical User Interfaces (GUIs)
2p0
Polymorphisme en C++

This document covers polymorphism in C++ through exercises involving class inheritance and virtual functions. Key concepts include method overriding and the behavior of virtual and non-virtual methods. It also involves hands-on coding examples to illustrate these concepts.

quot
const
cout
École Nationale des Sciences de l'Informatique (ENSI)3p0
Généricité & Collections en JAVA

This document introduces the concept of generic programming and its application to collections in Java. It transitions from fundamental implementations of stacks, using linked lists and arrays, to more advanced variations utilizing Java's generics. Various exercises encompass creating generic classes, implementing abstract data types, and utilizing Java's core collection framework with examples of ArrayList, LinkedList, and HashMap. Additionally, an exercise guides the creation of a task management system using object relationships and generics for modularity and scalability.

generics
Collection API
type safety
9p0
Gestion des exceptions en JAVA

The document elaborates on designing and handling exceptions in Java through structured exercises. It contrasts checked and unchecked exceptions, illustrating why certain methods compile without errors while others require explicit exception handling. The exercises delve into hierarchical exception management with try-catch-finally blocks, explaining behavior under varying exception instances and exploring custom exception handling mechanisms, such as AgeCapException. The final part introduces iterative exception handling with error tracking for user input validation.

exceptions
RuntimeException
IOException
3p0
Optimisation Combinatoire : Méthodes Approchées

This document discusses solving combinatorial optimization problems, particularly focusing on the Traveling Salesman Problem (TSP) using genetic algorithms. It includes a specific coding approach for the problem and outlines a multi-objective knapsack problem with constraints. The proposed solutions involve transforming problems into single-objective formats and applying greedy algorithms.

quot
probl
algorithme
3p0
Complexité Algorithmique

This document contains an exam focused on algorithmic complexity, detailing various problems related to complexity classes, computational operations, and permutations. Students are required to analyze the performance and complexities of algorithms through theoretical and practical exercises. The exam is structured to test understanding of asymptotic notations and their applications in real scenarios.

quel
complexite
donner
1p0
Complexité Algorithmique

This document presents an exam for the module on algorithmic complexity, including problems on matrix multiplication, hash algorithms, and asymptotic complexity. Students are required to write algorithms, analyze time complexity, and calculate asymptotic complexities for given operations. The exam is structured into three main exercises, each targeting different aspects of algorithmic analysis.

while
complexite
rations
1p0
Module PO: Inheritance and Polymorphism

This document provides a series of exercises to implement Java programs showcasing inheritance and polymorphism concepts. Key tasks include creating classes for geometric shapes like points, rectangles, circles, and cylinders, along with methods to compute dimensions, display graphical forms, and override the 'toString' method for detailed object representation. Additionally, the exercises emphasize the testing of polymorphism principles through systematic class hierarchy usage and object manipulation.

Inheritance
Polymorphism
Point and Rectangle Classes
Institut Supérieur des Études Technologiques de Bizerte1p0
Programmation Orientée Objet

This document presents the course content for an Object-Oriented Programming class. It includes various exercises focusing on Java programming, such as handling variables, arrays, and string manipulation. Each exercise aims to develop fundamental programming skills in Java.

programme
ecrire
tableau
2p0
Généricité et collections en JAVA

This document explores Java's generic programming capabilities and their application in collections. It introduces key concepts like generic types and interfaces, showcasing their importance through hands-on exercises such as implementing stacks (using both arrays and linked lists), creating complex tasks with hierarchical structures, and managing contact directories via HashMaps. The methodology focuses on transforming existing code into generic implementations, using Java's core collection frameworks to emphasize the extensibility and type safety of generics. The findings highlight practi...

generics
collections
Java
9p0
Genericity & Collections in Java

The document introduces the concept of genericity in Java and demonstrates its application using collections such as LinkedList and ArrayList. It provides step-by-step exercises to implement generic stacks, using interfaces and extending key Java classes like Collection and LinkedList, for better type-safety and reusability. The exercises also cover implementing generic tasks and building a phonebook using HashMaps, emphasizing the importance of data structures with type parameters. Each task highlights practical code examples and challenges to learn about Java's generics and collections API.

Genericity
Java Collections API
Stack Implementation
9p0

Autres ressources en programmation