ADS logo Algorithms & Data Structures

Minimum requirements for project

  • Create console application which should work. You must present your created software during theory lecture before exam session start. for more details you will find information down bellow in preparation steps.

Preparation steps for project

  • Step 1. The team must come up with a theme and create console application. Also you can choose topic from given [list of topics].
  • Step 2. Project is for group of 2-5 students when you have your members you must choose team leader. When you have team leader you must think your team name and click this button + Create Team to register your team and get unique github URL address for project repository where you should place your project.
  • Step 3. Give permissions when you click this button: Authorize github.

Prisijungti prie projekto

  • Step 4. Into “OR Create a new team” field enter your team name and click: + Create Team button.

Sukurti komanda

After step 4 your will automatically get random repository and URL address where you must place your code and code changes e.g. https://github.com/pratybos/ads-project-2019-programers. Using this URL address all team members should place code changes “commits” during project creation.

prisijunges_prie_team

Two options to join a team:

  • Option 1. Press same button in step 4 and choose your team where you would like to join.
  • Option 2. First you need open control panel and pick your team using this link: https://github.com/orgs/pratybos/teams/. Then team leader or member which is registered your team should invite members. In control panel you see choose Members tab and add member using Github username.

dif

  • Step 5. Team leader should create README.MD with short picked topic description, team members names and individual tasks, folder structure ect. Individual task example. If your choosen topic is Car rental park Team leader should manage a tasks for team members (Team leader, Tomas, Birutė ….):
    • Team leader. Create the object / record / structure of the Car, Driving School and the necessary functions for this: choose the exam date, exam date, instructor ect.
    • Tomas. Create an object / record / structure of the Employee and the necessary functions for: buy a car, hire instructor, etc.
    • Birutė. Create the object / item / structure of the Client and to the necessary functions for: Examination storage, attendance of theoretical lectures, hours of driving left, instructor choice, etc. Every member progress should display in Github enviroment commit tab. For e.g. Commit tab where you can see a member progress:
  • Step 6. Project progress should be visible during semester in Github created team repository. Every member code changes should visible in commit tab. Down bellow image you see simple example how history should look like.

commits

Single commit or code change example

commits_expand

SIMPLE PROJECT EXAMPLE


// Main language C
// @Authors Augustinas Jonušas, Augustas Matorka, Vilius Dudlauskas, Edgaras Blinkovas.
// Group PI17B, PI17E

include <iostream>
#include <string>
#include <time.h>
#include <stdlib.h>
using namespace std;

double pinigai=1000;
double d=0;
double mp=0;

struct virejas {
int studentas=0, eilinis=0, pazenges=0;
};

struct pastatai {
string kavine="Kavine", kioskas="Kioskas", restoranas="Restoranas";
string turimospatalpos = "";
};

void clear() {
 system("CLS");
}

void DienosPietuSudarymas(double &suma);
void samdytivirejus(virejas &samdyti);
void patalpos (pastatai &pirkti);
void lankytojai(virejas samdyti, pastatai pirkti, double &suma);
void ValgyklosPersonalas(virejas samdyti, pastatai pirkti);

int main ()
{
    double suma = 0;

    pastatai pirkti;
    virejas samdyti;
    int x;
    bool loop=true;
    while (loop==true){
            if (pinigai>=1000000)
    {
        cout<<"!!!!  JUS PEREJOTE ZAIDIMA  !!!!"<<endl;
        break;
    }
        else if (pinigai <= -50000)
                    cout<<"Jus bankrutavote, bandykite vel! :("<<endl;
    {



    cout<<"Biudzetas (your budget): "<<pinigai<< " eur" <<endl;
    cout<<"1: Dienos pietu sudarymas (create your daily menu)"<<endl;
    cout<<"2: Pirkti patalpas (buy quaters)"<<endl;
    cout<<"3: Praleisti diena (skip a day)"<<endl;
    cout<<"4: Samdyti virejus (hire employees)"<<endl;
    cout<<"5: Patikrinti personala (get your employees list)"<<endl;
    cout<<"6: Pradeti zaidima is naujo (start game again)"<<endl;
    cout<<"7: Isvalyti ekrana (clean screen text)"<<endl;
    cout<<"0: Baigti zaidima (end game)"<<endl;

    cin>>x;

            if (x>7||x<0)
    {
        cout << "Toks punktas nerastas" << endl;
    }
            else if (x==0)
    {
            exit(0);
    }
            else
    {
    switch (x){
    case 1:
    DienosPietuSudarymas(suma);
    break;
    case 2:
    patalpos (pirkti);
    break;
    case 3:
    if (suma==0)
    {
        cout << "Jus dar nesudarete dienos pietu meniu!" << endl;
    }
    else if (pirkti.turimospatalpos == "")
        cout << "Jus dar neturite savo patalpos!" << endl;
    else
        lankytojai(samdyti, pirkti, suma);

    break;
    case 4:
    samdytivirejus(samdyti);
    break;
    case 5:
    ValgyklosPersonalas(samdyti, pirkti);
    break;
    case 6:
    pinigai = 1000;
    return main();
    break;
        case 7:
    clear();
    ;
    break;

    }
    }
    }
    }

    return 0;
}
void DienosPietuSudarymas(double &suma)
{
    suma=0;
    string dienospietus = "";

    int pagr, ger, des;

    cout << "1:  Blynai (pancakes) - 2.5 eur" << endl;
    cout << "2:  Cepelinai ('zeppelins' lithuanian dish) - 3.5 eur" << endl;
    cout << "3:  Saltiena (meat jelly) - 2 eur" << endl;
    cout << "4:  Lydeka (pike) - 3 eur" << endl;
    cout << "5:  Vistiena (chicken) - 2.5 eur" << endl;
    cout << "6:  Kiauliena (pork) - 2.2 eur" << endl;
    cout << "7:  Jautiena (beef) - 3 eur" << endl;
    cout << "Pasirinkite pagrindini patiekala (choose your main course)" << endl;
    cin >> pagr;

    while (pagr>7|| pagr<1)
    {
    cout << "Toks punktas nerastas (sorry menu item not exists!)" << endl;

    cout << "Pasirinkite pagrindini patiekala (choose your main course)" << endl;
    cin >> pagr;
    }

 switch(pagr)
    {
    case 1:
    dienospietus += "Blynai (pancakes)";
    suma += 2.5;
    break;

    case 2:
    {
    dienospietus += "Cepelinai ('zeppelins')";
    suma += 3.5;
    break;
    }

    case 3:
    {
    dienospietus += "Saltiena (meat jelly)";
    suma += 2;
    break;
    }

    case 4:
    {
    dienospietus += "Lydeka (pike)";
    suma += 3;
    break;
    }

    case 5:
    {
    dienospietus += "Vistiena (chicken)";
    suma += 2.5;
    break;
    }

    case 6:
    {
    dienospietus += "Kiauliena (pork)";
    suma += 2.2;
    break;
    }

    case 7:
    {
    dienospietus += "Jautiena (beef)";
    suma += 3;
    break;
    }
    }


    cout << "1: Arbata (tea) - 0.3 eur" << endl;
    cout << "2: Sultys (fresh juice) - 0.6 eur" << endl;
    cout << "Pasirinkite gerima (choose your drink)" << endl;
    cin >> ger;

    while (ger>2||ger<1)
    {
    cout << "Toks punktas nerastas (sorry menu item not exists!)" << endl;

    cout << "Pasirinkite gerima (choose your drink)" << endl;
    cin >> ger;
    }

    switch(ger)
        {
    case 1:
    dienospietus += "Arbata (tea)";
    suma += 0.3;
    break;

    case 2:
    {
    dienospietus += "Sultys (fresh juice)";
    suma += 0.6;
    break;
    }
        }


    cout << "1: Tortas (pie) - 1 eur" << endl;
    cout << "2: Ledai (ice cream) - 0.8 eur" << endl;
    cout << "Pasirinkite deserta (choose your desert)" << endl;
    cin >> des;

    while (des>2||des<1)
    {
    cout << "Toks punktas nerastas (sorry menu item not exists!)" << endl;

    cout << "Pasirinkite deserta (choose your desert)" << endl;
    cin >> des;
    }

    switch(ger)
        {
    case 1:
    dienospietus += "Tortas (pie)";
    suma += 1;
    break;

    case 2:
    {
    dienospietus += "Ledai (ice cream)";
    suma += 0.8;
    break;
    }
        }

    cout << "Jusu dienos pietu dabartinis meniu (your current lunch list)" << dienospietus << endl;
    cout << "Jusu dienos pietu dabartine kaina (price for current lunch list)" << suma << " eur" << endl;


}
void samdytivirejus(virejas &samdyti)
{
    int x;
    cout<<"Koki vireja nori pasisamdyti? (hire new employee)"<<endl;
    cout<<"1: Studentas (student) [1000 eur]"<<endl;
    cout<<"2: Eilinis (middle) [2000 eur]"<<endl;
    cout<<"3: Pazenges (chef) [5000 eur]"<<endl;
    cin>>x;
    switch (x){
case 1:
    if(pinigai>=1000)
    {samdyti.studentas++;pinigai-=1000;}
    else {cout<<"Uzsidirbk pinigu nes tu ju neturi (earn more money because you dont have it!)"<<endl;}
    break;

case 2:
    if(pinigai>=2000)
    {samdyti.eilinis++;pinigai-=2000;}
    else{cout<<"Uzsidirbk pinigu nes tu ju neturi (earn more money because you dont have it!)"<<endl;}
    break;

case 3:
    if(pinigai>=5000)
    {samdyti.pazenges++;pinigai-=5000;}
    else
    {cout<<"Uzsidirbk pinigu nes tu ju neturi (earn more money because you dont have it!)"<<endl;}
    break;

default:
    cout<<"Nera tokios ivesties (sorry menu item not exists!)"<<endl;
    break;
    }
}
void patalpos (pastatai &pirkti)
{
    int x;
    cout<<"Kokias patalpas nori issinuomoti arba nusipirkti? choose your quaters you would like to buy?"<<endl;
    cout<<"1: Pirkti kioska (kiosk) [700 eur]"<<endl;
    cout<<"2: Pirkti kavine (cafe) [5000 eur]"<<endl;
    cout<<"3: Pirkti restorana (restaurant) [15000 eur]"<<endl;
    cin>>x;
    switch (x){

    case 1:
    if(pinigai>= 700)
    {
        pirkti.turimospatalpos=pirkti.kioskas;
        pinigai-=700;
    }
    else
    {cout<<"Tu neturi tiek pinigu (not enough funds!)"<<endl;}
    break;

    case 2:
        if(pinigai>= 5000)
    {pirkti.turimospatalpos=pirkti.kavine;
    pinigai-=5000;}
    else {cout<<"Tu neturi tiek pinigu (not enough funds!)"<<endl;}
    break;

    case 3:
        if(pinigai>=15000)
    {pirkti.turimospatalpos=pirkti.restoranas;
    pinigai-=15000;}
    else {cout<<"Tu neturi tiek pinigu (not enough funds!)"<<endl;}
    break;

default:
cout<<"Nera tokios parinkties (sorry menu item not exists!)"<<endl;
break;
}

int i = 0, n;
}
void lankytojai(virejas samdyti, pastatai pirkti, double &suma)
{

double n;
int lanksk;
double lankpeln;
srand (time(NULL));
double lankindik = ( 2.5 + 1.3 * samdyti.studentas + 1.5 * samdyti.eilinis + 2 * samdyti.pazenges);

if (pirkti.turimospatalpos == "Kioskas")
n = 2.5 * lankindik;
else if (pirkti.turimospatalpos == "Kavine")
n = 3 * lankindik;
else if (pirkti.turimospatalpos == "Restoranas")
n = 4 * lankindik;

lanksk = 5 + (rand()% 5+1) * n;

lankpeln = lanksk * suma * ( 2 + samdyti.studentas * 5 + samdyti.eilinis * 10 + samdyti.pazenges * 15);
cout<<"Siandien jus gavote (today profit:"<<lankpeln<<") pelno"<<endl;
cout<<"Siandien jus sulaukete (today visitors: "<<lanksk<<") lankytoju"<<endl;
d++;
mp=mp+lankpeln;
pinigai+=lankpeln;

if(d==30)
{
  cout<<"Praejo menuo ir turejote valstybei sumoketi:  (every month you must pay taxes)"<<mp*0.21<<" euru mokesciu"<<endl;
  cout<<"taip pat ismokejote algas savo darbuotojams: (also you need pay salaries for your employees) " << ((samdyti.studentas * 500) +   (samdyti.eilinis * 1000) + (samdyti.pazenges * 2000)) << " euru" <<endl;
pinigai = pinigai - (mp*0.21) - ((samdyti.studentas * 500) +   (samdyti.eilinis * 1000) + (samdyti.pazenges * 2000));
    d=0;
    mp=0;
}
else{}
}

void ValgyklosPersonalas(virejas samdyti, pastatai pirkti)
{
    if (samdyti.studentas > 0)
    cout << "Studentu vireju: (student cook)" << samdyti.studentas << endl;

    if (samdyti.eilinis > 0)
    cout << "Eiliniu vireju: (middle cook)" << samdyti.eilinis << endl;

    if (samdyti.pazenges > 0)
    cout << "Pazengusiu vireju: (chef)" << samdyti.pazenges << endl;

    if (samdyti.studentas == 0 && samdyti.eilinis == 0 && samdyti.pazenges == 0)
    cout << "Kolkas dirbi vienas (at a moment you working alone!)" << endl;
}