Advertisement
Guest User

Untitled

a guest
Dec 11th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.69 KB | None | 0 0
  1. // ConsoleApplication1.cpp : This file contains the 'main' function. Program execution begins and ends there.
  2. //
  3.  
  4. #include "pch.h"
  5. #include <iostream>
  6. #include <string>
  7. #include <vector>
  8. using namespace std;
  9. void AddEmployer();
  10. int returnpaye(int salaire);
  11. void RechercherEmployer();
  12. void SupprimerEmployer();
  13. void AfficherTout();
  14.  
  15. struct Personne {
  16. string Prenom;
  17. string Nom;
  18. };
  19.  
  20. struct Empl {
  21. int NoEmpl;
  22. Personne Identiter;
  23. string Position;
  24. int salaire;
  25. int telephone;
  26. };
  27.  
  28. vector <Empl> Employers;
  29.  
  30. int main()
  31. {
  32. debut :
  33. cout << "Gestion des Employes" << endl;
  34. cout << endl << "1. Saisir les employes et calculer la paie hebdomadaire" << endl;
  35. cout << "2. Rechercher un employe par son nom de famille et le supprimer" << endl;
  36. cout << "3. Afficher les informations des employes" << endl;
  37. cout << "4. Quitter l'application avec confirmation" << endl;
  38. cout << endl <<"Veuillez entrez votre choix :" ;
  39. int Option;
  40. cin >> Option;
  41. switch (Option) {
  42. case 1:
  43. AddEmployer();
  44. system("cls");
  45. goto debut;
  46. break;
  47. case 2 :
  48. RechercherEmployer();
  49. system("cls");
  50. goto debut;
  51. break;
  52. case 3 :
  53. AfficherTout();
  54. system("cls");
  55. goto debut;
  56. break;
  57. case 4 :
  58. break;
  59. default :
  60. break;
  61.  
  62. }
  63.  
  64.  
  65. }
  66.  
  67. void AddEmployer()
  68. {
  69. Empl NouvelleEmployer;
  70. cout << "Numero du nouvelle employer :" << endl;
  71. cin >> NouvelleEmployer.NoEmpl;
  72. cout << "Prenom du nouvelle employer :" << endl;
  73. cin >> NouvelleEmployer.Identiter.Prenom;
  74. cout << "Nom du nouvelle employer :" << endl;
  75. cin >> NouvelleEmployer.Identiter.Nom;
  76. cout << "Position du nouvelle employer : " << endl;
  77. getline(cin, NouvelleEmployer.Position);
  78. cout << "Numero de telephone du nouvelle employer :" << endl;
  79. cin >> NouvelleEmployer.telephone;
  80. cout << "Salaire annuel du nouvelle employer :" << endl;
  81. cin >> NouvelleEmployer.salaire;
  82. cout << "la paye hebdomadaire de se salarier sera de : " + returnpaye(NouvelleEmployer.salaire);
  83. Employers.push_back(NouvelleEmployer);
  84. cout << "L'employer a bien ete sauvegarder";
  85. }
  86.  
  87. int returnpaye(int salaire)
  88. {
  89. float salaireparmois = salaire / 12;
  90. float salaireparsemaine = salaireparmois / 4;
  91.  
  92. return salaireparsemaine;
  93. }
  94.  
  95. void RechercherEmployer()
  96. {
  97. string nomdelapersonne;
  98. cout << "Entrez le nom de famille de la personne que vous rechercher : " << endl;
  99. getline(cin, nomdelapersonne);
  100. for (size_t i = 0; i < Employers.size(); i++)
  101. {
  102. if (Employers[i].Identiter.Nom == nomdelapersonne)
  103. {
  104. SupprimerEmployer();
  105. }
  106. }
  107. }
  108.  
  109. void SupprimerEmployer()
  110. {
  111. }
  112.  
  113. void AfficherTout()
  114. {
  115. for (size_t i = 0; i < Employers.size();i++)
  116. {
  117. cout << "Numero employer : " << Employers[i].NoEmpl <<"";
  118. }
  119. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement