Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "eile.h"
- #include <iostream>
- #include <stdio.h>
- #include <conio.h>
- #include <string>
- #include <stdlib.h>
- #include <windows.h>
- #include <sstream>
- using namespace std;
- eilesSaras Sarasas; //sukuriamas dekas
- Duomenys Strugt;
- int i=0,a=0;
- void registravimas(){
- //--------------------------------------------------------------------------------------
- i++;
- cout << "Iveskite atejusi klienta" << endl;
- cin >>Strugt.vardas;
- Strugt.vieta = i;
- //--------------------------------------------------------------------------------------
- Sarasas.idetPaskutini(Strugt);
- }
- void autozi(){
- string temp;
- std::stringstream temp2;
- for (int y=i; y<10; y++){
- //temp2.clear();
- temp2<<y;
- temp="klientas";
- temp=temp + temp2.str();
- Strugt.vardas= temp;
- Strugt.vieta = y;
- Sarasas.idetPaskutini(Strugt);
- }
- }
- void klausiam(){
- string temp;
- int ii;
- Sarasas.nullinam();
- for (ii=1; ii<3; ii++){
- cout << "iveskite klienta " << endl;
- cin>>temp;
- Sarasas.ieskom(temp, ii);
- }
- }
- void KlijentuAptarnavimas(){
- Sarasas.salintPirma();
- a=a+1;
- if (a==3){
- klausiam();
- Sarasas.displayList();
- getch();
- }
- }
- void vidurys(){
- Sarasas.salintiVidury(8);
- Sarasas.displayList();
- getch();
- }
- void atvazduotKiljentus(){
- Sarasas.displayList();
- getch();
- }
- int main(){
- while(1)
- {
- int c;
- system("cls");
- cout << " Klientu numatoma eile" << endl;
- cout << "---------------------------------------------" <<endl;
- cout << "[1] Klientu registravimas " << endl;
- cout << "[2] Aptarnauti klienta" << endl;
- cout << "[3] Atvaizduoti visus klientus" << endl;
- cout << "[4] Automatinis duomenu uzpildymas" << endl;
- cout << "---------------------------------------------" <<endl;
- scanf("%d",&c);
- system("cls");
- if(c<1 || c>5){
- printf("Invalid Choise\n");
- }
- else if(c==1)
- registravimas();
- else if(c==2)
- KlijentuAptarnavimas();
- else if(c==3)
- atvazduotKiljentus();
- else if(c==4)
- autozi();
- else if(c==5)
- vidurys();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement