This repository contains a series of assignments and projects for the Advanced Programming course (APS02) at the University of Tehran. Each project focuses on different areas of programming, including data processing, algorithm implementation, object-oriented principles, and interactive simulations.
- CA0: Basic Algorithmic Logic
- CA1: Day Tracking
- CA2: Matrix Operations
- CA3: Schedule Planner
- CA4: Basic String Manipulation
- CA5: Turtix Game
- CA6: Mission Tracker
- CA7: Fantasy Football Team Manager
- Input/Output Handling: Reading inputs and outputting data to the console, forming the backbone of almost any application.
- Conditionals and Logic: Using
if
,else
, and conditional expressions to determine specific actions based on input values. - Loops: Utilizing loops (
for
,while
) to iterate over data or perform repetitive tasks.
To practice computational thinking and develop a basic understanding of control flow in a program.
- Conditional Statements: Implementing logic to handle various conditions.
- Iteration Structures: Using loops to process data.
- I/O Handling in C++: Reading from and writing to the console.
- Data Structures: Using arrays or
std::map
for managing date-event pairs to store, retrieve, and manipulate date-specific data. - String Manipulation: Handling text data and parsing strings to extract and store relevant information.
- File Handling: Introducing saving and retrieving data from files for persistent storage.
- Algorithm Design: Handling commands to find the "longest" or "most eventful" day by analyzing event descriptions or data.
To cover basic data storage, lookup, and retrieval through dynamic input, manipulating text and dates to find specific days that meet particular conditions.
- Data Structures: Using
std::map
,std::vector
. - String Handling: Utilizing functions like
getline
,substr
. - File I/O: Reading from and writing to files.
- Searching Algorithms: Implementing efficient search techniques.
- 2D Arrays: Using two-dimensional arrays to store matrix data.
- Matrix Transformation: Performing operations like rotation, transposition, and reflection.
- Linear Algebra: Understanding how matrices work in mathematics, especially for transformations like matrix multiplication.
- Input Parsing: Reading matrix data from user inputs or files and converting them into arrays for computation.
To implement matrix-based algorithms and practice handling multi-dimensional data structures.
- Matrix Manipulation: Using nested loops for operations.
- Linear Algebra Concepts: Applying mathematical principles to programming.
- 2D Arrays: Managing multi-dimensional data.
- Scheduling Algorithms: Writing a simple scheduling system to avoid conflicts in class or teacher schedules.
- Optimization: Implementing strategies to fit courses into schedules without conflicts.
- File I/O: Reading and writing data related to teacher schedules, free days, and course timings.
- Data Structures: Using arrays,
std::vector
, orstd::map
to store teachers, courses, and their available times.
To simulate a scheduling problem using optimization and data organization strategies.
- Conflict Detection Algorithms: Implementing logic to avoid scheduling overlaps.
- Sorting and Searching: Organizing data efficiently.
- File Handling: Persisting schedule data.
- String Handling: Manipulating strings, such as converting lowercase to uppercase.
- Text Parsing: Extracting data from strings and removing unnecessary characters.
- File I/O: Reading input from text files and writing outputs.
- Functions: Implementing helper functions to perform specific tasks.
To develop a tool for processing and manipulating text.
- String Manipulation: Using C++ string functions.
- File Reading/Writing: Handling files for input and output.
- Function Creation: Writing reusable code blocks.
- Object-Oriented Programming (OOP): Using classes to represent game entities like the turtle, stars, and enemies.
- Graphical Libraries: Utilizing SFML (Simple and Fast Multimedia Library) for graphics, window management, and event handling.
- Event-Driven Programming: Responding to user inputs in real-time.
- Collision Detection: Detecting interactions between game entities.
- Game Design: Implementing game logic, character movement, scoring, and enemy interaction.
To build a simple graphical game using object-oriented principles and game development concepts.
- OOP Principles: Encapsulation, inheritance, and polymorphism.
- SFML for Game Development: Handling graphics and events.
- Real-Time Event Handling: Processing inputs as they occur.
- Collision Detection Algorithms: Implementing bounding box checks.
- Data Management: Using structs or classes to represent missions that can be assigned, tracked, and completed.
- OOP Principles: Focusing on encapsulation and methods for managing mission states.
- Data Structures: Using
std::vector
orstd::map
to store multiple missions and track their status. - Error Handling: Managing invalid inputs gracefully.
- File I/O: Persisting mission states across program executions.
To implement a mission management system where users can assign, update, and track tasks.
- OOP: Designing classes with attributes and methods.
- File I/O: Reading and writing mission data.
- Status Management: Using enums or constants.
- Error Handling in C++: Handling exceptions and invalid inputs.
- File Handling (CSV Parsing): Working with CSV files to store player information, team budgets, and match statistics.
- Object-Oriented Programming: Representing players and teams with objects that have properties like cost, points, and position.
- Budget Management: Implementing algorithms to manage team budgets while selecting players.
- Polymorphism: Managing different roles of players and adapting team behavior.
- Dynamic User Interaction: Handling user inputs for buying players, selecting captains, and viewing statistics.
To build a fantasy football management system with complex interactions between players, teams, and finances.
- OOP (Inheritance and Polymorphism): Designing flexible class hierarchies.
- CSV File Parsing: Reading and writing player data.
- Error Handling: Managing invalid operations.
- Dynamic I/O Functions: Interactive command-line interfaces.
To execute the projects:
-
Clone the repository:
git clonehttps://github.com/tahamajs/Advanced_programming_Projects.git
-
Navigate to the project directory:
cd advanced-programming-projects
-
Build and run the desired project:
-
Navigate to the specific assignment folder (e.g.,
CA0
) and follow the build instructions provided in theREADME.md
orinstructions.txt
within that folder. -
Compile the code using a C++ compiler (e.g.,
g++
,clang++
):cd CA0 g++ -std=c++11 main.cpp -o main ./main
-
For projects using SFML (e.g., CA5), ensure SFML is installed and linked during compilation.
g++ -std=c++11 main.cpp -o game -lsfml-graphics -lsfml-window -lsfml-system ./game
-
Replace
main.cpp
with the appropriate source files if necessary.
-
Ensure you have the following installed:
- C++ Compiler: GCC, Clang, or MSVC supporting C++11 or later.
- SFML Library: For projects like CA5 (Turtix Game).
- Standard C++ Libraries: For data structures and algorithms.
- Additional Libraries: As specified in individual project folders.
- Course: Advanced Programming (APS02)
- University: University of Tehran
- Instructor: Dr Ramtin Khosravi
- Field: Computer Engineering
This repository was created as part of the coursework for the Advanced Programming course at the University of Tehran. All rights to the content are reserved.
If you have any questions or suggestions, please open an issue or submit a pull request.
- SFML Documentation: SFML Official Site
- C++ Reference: cplusplus.com or cppreference.com
Feel free to explore each assignment folder for detailed code implementations, reports, and additional resources related to each project.