Skip to content

fabianmiu15/POO

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Tourism Management System (C++ | OOP)

This project is an Object-Oriented Programming application written in C++ that simulates the management system of a tourism agency.
It demonstrates advanced OOP concepts such as inheritance, polymorphism, operator overloading, templates, exception handling, STL containers and design patterns.


Project Overview

The application models the main components of a tourism agency system including:

  • clients
  • tourist packages
  • hotels
  • transport services
  • accommodation services
  • travel destinations
  • premium travel destinations
  • tourism agency management

The system allows adding, displaying, sorting and managing travel destinations and tourism services using an interactive console menu.


Object-Oriented Programming Concepts Implemented

The project demonstrates multiple OOP principles:

Encapsulation

All classes use private attributes and provide getters and setters for controlled access.

Inheritance

Multiple inheritance hierarchies are implemented:

Destinatie
   ↓
DestinatieTuristica
   ↓
DestinatiePremium

Another hierarchy implements diamond inheritance:

           IServiciuTuristic
            /            \
       Transport        Cazare
            \            /
           PachetTuristic

Polymorphism

Virtual methods allow dynamic dispatch when working with base class pointers.

Example:

virtual void afiseazaDetalii() const = 0;

Operator Overloading

Several operators are overloaded, including:

  • << and >> for input/output streams
  • +, -, * for modifying prices
  • ++ and --
  • ==, !=, <
  • [] for indexed access

Constructors and Destructors

Each class implements:

  • default constructors
  • parameterized constructors
  • copy constructors
  • destructors
  • assignment operators

Advanced C++ Features

The project also includes more advanced C++ programming concepts.

Templates

A generic repository class is implemented using templates:

template<typename T>
class Repository
{
private:
    vector<T> items;
};

Template functions are also used for:

  • sorting collections
  • finding maximum elements

Exception Handling

Custom exception classes are implemented:

  • TourismException
  • InvalidDataException
  • FileException
  • NotFoundException

Example:

class InvalidDataException : public TourismException
{
public:
    InvalidDataException(const string& msg)
        : TourismException("Date invalide: " + msg) {}
};

STL Containers

The project uses multiple STL containers:

  • vector
  • set
  • list
  • map

Example:

vector<shared_ptr<Destinatie>> destinatii;
set<string> tari;
list<string> rezervari;
map<string, int> statisticiTari;

These containers are used for storing destinations, reservations and country statistics.


Design Pattern – Singleton

The Singleton pattern is implemented for the tourism agency management class.

class AgentieTurism
{
private:
    static AgentieTurism* instance;
};

This ensures that only one instance of the tourism agency exists in the program.


Technologies Used

  • C++
  • Object-Oriented Programming
  • STL Containers
  • Templates
  • Exception Handling
  • Smart Pointers
  • Design Patterns (Singleton)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages