Skip to content

Explore Object-Oriented Programming principles with this C++ voting system, showcasing inheritance, abstraction, polymorphism, and operator overloading through an interactive voting model.

Notifications You must be signed in to change notification settings

alexjilavu29/Vote-Counting-System-OOP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Voting System in C++

Description

This C++ project implements a voting system, demonstrating the application of Object-Oriented Programming (OOP) principles through the use of inheritance, abstraction, polymorphism, and operator overloading.

Main Features

  • Abstract Class Partid: Serves as a base for different types of political parties, using inheritance and virtual methods.
  • Read and Display: Implemented through dedicated classes (Citire, Afisare) that override the input (>>) and output (<<) operators.
  • Polymorphism: Demonstrated through virtual methods that are overridden in derived classes.
  • Operator Overloading: Illustrated by overriding addition operators to add votes to parties.

Usage

  • Create instances of parties and manipulate them through specified methods.
  • Interact with the user to read data from the console and display results.

Code Example

Partid* p1 = new Partid_definit1("PSD", 10000);
Partid* p2 = new Partid_definit2("PNL", 20000);
vector<Partid*> Partide{ p1,p2 };
afisare2(Partide);

Contributions

Contributions are welcome to expand and improve the voting system.

Romanian Translation Below


Sistem de Votare în C++

Descriere

Acest proiect C++ implementează un sistem de votare, demonstrând aplicarea principiilor Programării Orientate pe Obiect (POO) prin utilizarea mostenirii, abstractizării, polimorfismului și încărcării operatorilor.

Caracteristici Principale

  • Clasa Abstractă Partid: Servește drept bază pentru diferite tipuri de partide politice, folosind mostenirea și metode virtuale.
  • Citire și Afisare: Implementate prin clase dedicate (Citire, Afisare) care suprascriu operatorii de input (>>) și output (<<).
  • Polimorfism: Demonstrat prin metode virtuale care sunt suprascrise în clase derivate.
  • Încărcarea Operatorilor: Exemplificată prin suprascrierea operatorilor de adunare pentru a adăuga voturi la partide.

Utilizare

  • Crearea instanțelor de partide și manipularea acestora prin metodele specificate.
  • Interacțiunea cu utilizatorul pentru citirea datelor de la consolă și afișarea rezultatelor.

Exemplu de Cod

Partid* p1 = new Partid_definit1("PSD", 10000);
Partid* p2 = new Partid_definit2("PNL", 20000);
vector<Partid*> Partide{ p1,p2 };
afisare2(Partide);

Contribuții

Contribuțiile sunt binevenite pentru extinderea și îmbunătățirea sistemului de votare.

About

Explore Object-Oriented Programming principles with this C++ voting system, showcasing inheritance, abstraction, polymorphism, and operator overloading through an interactive voting model.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages