Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ConsoleApplication1.cpp : This file contains the 'main' function. Program execution begins and ends there.
- //
- #include "pch.h"
- #include <iostream>
- #include <string>
- #include <vector>
- using namespace std;
- void AddEmployer();
- int returnpaye(int salaire);
- void RechercherEmployer();
- void SupprimerEmployer();
- void AfficherTout();
- struct Personne {
- string Prenom;
- string Nom;
- };
- struct Empl {
- int NoEmpl;
- Personne Identiter;
- string Position;
- int salaire;
- int telephone;
- };
- vector <Empl> Employers;
- int main()
- {
- debut :
- cout << "Gestion des Employes" << endl;
- cout << endl << "1. Saisir les employes et calculer la paie hebdomadaire" << endl;
- cout << "2. Rechercher un employe par son nom de famille et le supprimer" << endl;
- cout << "3. Afficher les informations des employes" << endl;
- cout << "4. Quitter l'application avec confirmation" << endl;
- cout << endl <<"Veuillez entrez votre choix :" ;
- int Option;
- cin >> Option;
- switch (Option) {
- case 1:
- AddEmployer();
- system("cls");
- goto debut;
- break;
- case 2 :
- RechercherEmployer();
- system("cls");
- goto debut;
- break;
- case 3 :
- AfficherTout();
- system("cls");
- goto debut;
- break;
- case 4 :
- break;
- default :
- break;
- }
- }
- void AddEmployer()
- {
- Empl NouvelleEmployer;
- cout << "Numero du nouvelle employer :" << endl;
- cin >> NouvelleEmployer.NoEmpl;
- cout << "Prenom du nouvelle employer :" << endl;
- cin >> NouvelleEmployer.Identiter.Prenom;
- cout << "Nom du nouvelle employer :" << endl;
- cin >> NouvelleEmployer.Identiter.Nom;
- cout << "Position du nouvelle employer : " << endl;
- getline(cin, NouvelleEmployer.Position);
- cout << "Numero de telephone du nouvelle employer :" << endl;
- cin >> NouvelleEmployer.telephone;
- cout << "Salaire annuel du nouvelle employer :" << endl;
- cin >> NouvelleEmployer.salaire;
- cout << "la paye hebdomadaire de se salarier sera de : " + returnpaye(NouvelleEmployer.salaire);
- Employers.push_back(NouvelleEmployer);
- cout << "L'employer a bien ete sauvegarder";
- }
- int returnpaye(int salaire)
- {
- float salaireparmois = salaire / 12;
- float salaireparsemaine = salaireparmois / 4;
- return salaireparsemaine;
- }
- void RechercherEmployer()
- {
- string nomdelapersonne;
- cout << "Entrez le nom de famille de la personne que vous rechercher : " << endl;
- getline(cin, nomdelapersonne);
- for (size_t i = 0; i < Employers.size(); i++)
- {
- if (Employers[i].Identiter.Nom == nomdelapersonne)
- {
- SupprimerEmployer();
- }
- }
- }
- void SupprimerEmployer()
- {
- }
- void AfficherTout()
- {
- for (size_t i = 0; i < Employers.size();i++)
- {
- cout << "Numero employer : " << Employers[i].NoEmpl <<"";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement