Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.03 KB | None | 0 0
  1.   #include "eile.h"
  2. #include <iostream>
  3. #include <stdio.h>
  4. #include <conio.h>
  5. #include <string>
  6. #include <stdlib.h>  
  7. #include <windows.h>
  8. #include <sstream>
  9.  
  10. using namespace std;
  11.  
  12. eilesSaras Sarasas; //sukuriamas dekas
  13. Duomenys Strugt;
  14. int i=0,a=0;
  15.  
  16.  
  17. void registravimas(){
  18. //--------------------------------------------------------------------------------------
  19.     i++;
  20.     cout << "Iveskite atejusi klienta" << endl;
  21.     cin >>Strugt.vardas;
  22.     Strugt.vieta =  i;
  23.    
  24. //--------------------------------------------------------------------------------------
  25. Sarasas.idetPaskutini(Strugt);
  26. }
  27. void autozi(){
  28. string temp;
  29.      std::stringstream temp2;
  30.     for (int y=i; y<10; y++){
  31.         //temp2.clear();
  32.         temp2<<y;      
  33.         temp="klientas";
  34.         temp=temp + temp2.str();
  35.         Strugt.vardas= temp;   
  36.         Strugt.vieta =  y;
  37.         Sarasas.idetPaskutini(Strugt);
  38.        
  39.         }
  40. }
  41.  
  42. void klausiam(){
  43. string temp;
  44. int ii;
  45. Sarasas.nullinam();
  46.     for (ii=1; ii<3; ii++){
  47.         cout << "iveskite klienta " << endl;
  48.         cin>>temp;
  49.  
  50.         Sarasas.ieskom(temp, ii);
  51.     }
  52. }
  53.  
  54.  
  55. void KlijentuAptarnavimas(){
  56. Sarasas.salintPirma();
  57. a=a+1;
  58. if (a==3){
  59. klausiam();
  60. Sarasas.displayList();
  61.     getch();
  62. }
  63. }
  64.  
  65. void vidurys(){
  66. Sarasas.salintiVidury(8);
  67. Sarasas.displayList();
  68.     getch();
  69.  
  70. }
  71.  
  72. void atvazduotKiljentus(){ 
  73.     Sarasas.displayList();
  74.     getch();
  75. }
  76.  
  77. int main(){
  78.     while(1)
  79.     {
  80.         int c;
  81.     system("cls");
  82.  
  83.     cout << "  Klientu numatoma eile" << endl;
  84.     cout << "---------------------------------------------" <<endl;
  85.     cout << "[1] Klientu registravimas " << endl;
  86.     cout << "[2] Aptarnauti klienta" << endl;
  87.     cout << "[3] Atvaizduoti visus klientus" << endl;
  88.     cout << "[4] Automatinis duomenu uzpildymas" << endl;
  89.     cout << "---------------------------------------------" <<endl;
  90.  
  91.     scanf("%d",&c);
  92.    
  93.     system("cls");
  94.    
  95.     if(c<1 || c>5){
  96.         printf("Invalid Choise\n");
  97.     }
  98.  
  99.     else if(c==1)
  100.         registravimas();
  101.     else if(c==2)
  102.         KlijentuAptarnavimas();
  103.     else if(c==3)
  104.         atvazduotKiljentus();
  105.     else if(c==4)
  106.         autozi();
  107.     else if(c==5)
  108.         vidurys();
  109.     }
  110.  
  111. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement