Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <cstdlib>
- #include <Windows.h>
- #include <locale>
- #include <conio.h>
- #include<cmath>
- #include<mmsystem.h>
- using namespace std;
- void Bulgarian();
- void English();
- void German();
- void language();
- void slowmotion();
- void slowmotion(string text);
- class Benz
- {
- class BMW;
- string model;
- int godina;
- double price;
- double speed;
- double weight;
- public:
- //Constructors
- Benz() {};
- Benz(string model, int godina, double price, double speed, double weight)
- {
- this->model = model;
- this->godina = godina;
- this->price = price;
- this->speed = speed;
- this->weight = weight;
- }
- Benz(const Benz& car)
- {
- this->model = car.model;
- this->godina = car.godina;
- this->price = car.price;
- this->speed = car.speed;
- this->weight = car.weight;
- }
- ~Benz() {};
- //Setters
- void setModel(string model) { this->model = model; }
- void setGodina(int godina) { this->godina = godina; }
- void setPrice(double price) { this->price = price; }
- void setSpeed(double speed) { this->speed = speed; }
- void setWeight(double weight) { this->weight = weight; }
- //Getters
- string getModel()const { return model; }
- int getGodina()const { return godina; }
- double getPrice()const { return price; }
- double getSpeed()const { return speed; }
- double getWeight()const { return weight; }
- //Operators
- friend ostream& operator<< (ostream&, const Benz&);
- friend istream& operator>> (istream&, Benz&);
- Benz& operator= (const Benz& car)
- {
- this->model = car.model;
- this->godina = car.godina;
- this->price = car.price;
- this->speed = car.speed;
- this->weight = car.weight;
- return (*this);
- }
- Benz operator+ (Benz& car)
- {
- this->model += car.model;
- this->godina += car.godina;
- this->price += car.price;
- this->speed += car.speed;
- this->weight += car.weight;
- return car;
- }
- Benz operator- (Benz& car)
- {
- this->price -= car.price;
- this->speed -= car.speed;
- this->weight -= car.weight;
- return car;
- }
- };
- ostream& operator<< (ostream& os, const Benz& benz)
- {
- os << "Ìîäåë: " << benz.model << endl;
- os << "Ãîäèíà: " << benz.godina << endl;
- os << "Öåíà: " << benz.price << endl;
- os << "Ñêîðîñò: " << benz.speed << endl;
- os << "Òåæåñò: " << benz.weight << endl;
- return os;
- }
- istream& operator>> (istream& is, Benz& benz)
- {
- cout << "Âúâåäåòå ìîäåë: ";
- is >> benz.model;
- cout << "Âúâåäåòå ãîäèíà: ";
- is >> benz.godina;
- cout << "Âúâåäåòå öåíà: ";
- is >> benz.price;
- cout << "Âúâåäåòå êîíñêèòå ñèëè: ";
- is >> benz.speed;
- cout << "Âúâåäåòå òåæåñò: ";
- is >> benz.weight;
- return is;
- }
- class BMW :public Benz
- {
- public:
- //Constructors
- BMW() {};
- BMW(string model, int godina, double price, double speed, double weight) :Benz(model, godina, price, speed, weight) {};
- ~BMW() {};
- //Normal Methods
- void setMembers(Benz& benz, BMW& bmw)
- {
- system("cls");
- cout << "Âúâåæäàíå íà ìîäèôèêàöèè çà Ìåðöåäåñ: " << endl;
- cin >> benz;
- cout << endl << "Âúâåæäàíå íà ìîäèôèêàöèè çà ÁÌÂ: " << endl;
- cin >> bmw;
- cout << endl;
- }
- void getMembers(Benz& benz, BMW& bmw)
- {
- system("cls");
- cout << "Ìåðöåäåñ ìîäèôèêàöèè: " << endl;
- cout << benz << endl;
- cout << "ÁÌÂ ìîäèôèêàöèè: " << endl;
- cout << bmw << endl;
- Sleep(5000); //delay - 5 sek.
- }
- double Tuning(Benz& benz, BMW& bmw)
- {
- system("cls");
- string choise;
- cout << endl << "Íàïèøåòå ->benz<- èëè ->bmw<- çà òóíèíã: ";
- cin >> choise;
- while (choise != "benz" && choise != "bmw")
- {
- cout << "Ãðåøíî âúâåäåíà ìàðêà!" << endl;
- cout << endl << "Íàïèøåòå ->benz<- èëè ->bmw<- çà òóíèíã: ";
- cin >> choise;
- }
- if (choise == "benz")
- {
- cout << endl << "Íàïèøåòå ->speed<- èëè ->weight<- çà ìîäèôèêàöèÿ: ";
- string c;
- cin >> c;
- while (c != "speed" && c != "weight")
- {
- cout << "Ãðåøíî âúâåäåíà ìîäèôåêàöèÿ!" << endl;
- cout << "Íàïèøåòå ->speed<- èëè ->weight<- çà ìîäèôèêàöèÿ: ";
- cin >> choise;
- }
- if (c == "speed")
- {
- double newSpeed;
- cout << "Âúâåäåòå ïîîâåøàâàíå íà ñêîðîñòòà: ";
- cin >> newSpeed;
- benz.setSpeed(newSpeed + benz.getSpeed());
- cout << "Ñêîðîñòòà áåøå òóíèíãîâàíà!" << endl;
- return benz.getSpeed();
- }
- if (c == "weight")
- {
- double newWeight;
- cout << "Âúâåäåòå ïîíèæàâàíå íà òåæåñòòà: ";
- cin >> newWeight;
- benz.setWeight(benz.getWeight() - newWeight);
- cout << "Òåæåñòòà áåøå òóíèíãîâàíà!" << endl;
- return benz.getWeight();
- }
- }
- if (choise == "bmw")
- {
- cout << endl << "Íàïèøåòå ->speed<- èëè ->weight<- çà ìîäèôèêàöèÿ: ";
- string c;
- cin >> c;
- while (c != "speed" && c != "weight")
- {
- cout << "Ãðåøíî âúâåäåíà ìîäèôåêàöèÿ!" << endl;
- cout << "Íàïèøåòå ->speed<- èëè ->weight<- çà ìîäèôèêàöèÿ: ";
- cin >> choise;
- if (c == "speed")
- {
- double newSpeed;
- cout << "Âúâåäåòå ïîâèøàâàíå íà ñêîðîñòòà: ";
- cin >> newSpeed;
- bmw.setSpeed(newSpeed + bmw.getSpeed());
- cout << "Ñêîðîñòòà áåøå òóíèíãîâàíà!" << endl;
- return bmw.getSpeed();
- }
- if (c == "weight")
- {
- double newWeight;
- cout << "Âúâåäåòå ïîíèæàâàíå íà òåæåñòòà: ";
- cin >> newWeight;
- bmw.setWeight(bmw.getWeight() - newWeight);
- cout << "Òåæåñòòà áåøå òóíèíãîâàíà!" << endl;
- return bmw.getWeight();
- }
- }
- }
- }
- void checkSpeed(Benz& benz, BMW& bmw)
- {
- system("cls");
- if (benz.getSpeed() > bmw.getSpeed())
- {
- cout << "Ìåðöåäåñà å ïî áúðç." << endl;
- }
- if (benz.getSpeed() < bmw.getSpeed())
- {
- cout << "ÁÌÂ å ïî áúðçî." << endl;
- }
- else if (benz.getSpeed() == bmw.getSpeed())
- {
- cout << "Åäíàêâà ñêîðîñò." << endl;
- }
- PlaySound(TEXT("cars2.wav"), NULL, SND_FILENAME | SND_ASYNC);
- }
- void slowmotion(string text) //Ôóíêöèÿ çà èçïèñâàíå íà òåêñòà áàâíî.
- {
- int p = 0;
- p = text.length();
- for (int i = 0; i < p; i++)
- {
- cout << text[i];
- Sleep(50);
- }
- }
- void language()
- {
- int welcome;
- do {
- system("cls");
- system("color 3f");
- system("mode 85,30");
- cout << "\n\n\n\n\n";
- cout << "\t\t\t\t Èçáåðåòå åçèê: \n"; Sleep(1000);
- cout << endl;
- cout << " \t\t\t\t ___________________" << endl;
- cout << " \t\t\t\t | |" << endl;
- cout << "\t\t\t\t | [1].Aíãëèéñêè. |\n"; Sleep(1000);
- cout << " \t\t\t\t | |" << endl;
- cout << "\t\t\t\t | [2].Áúëãàðñêè. |\n"; Sleep(1000);
- cout << " \t\t\t\t | |" << endl;
- cout << "\t\t\t\t | [3].Íåìñêè |\n"; Sleep(1000);
- cout << " \t\t\t\t | |" << endl;
- cout << "\t\t\t\t | [0].Èçõîä |\n"; Sleep(1000);
- cout << " \t\t\t\t |___________________|" << endl;
- cout << endl;
- cout << "\t\t\t\t Âàøèÿò èçáîð:";
- cin >> welcome;
- switch (welcome)
- {
- case 1:English();
- case 2:Bulgarian();
- case 3:German();
- case 0:system("cls");
- cout << "\n\n\n\n\n";
- slowmotion("\t\t\t\t Áëàãîäàðÿ çà Âíèìàíèåòî! \n\n");
- slowmotion("\t\t\t\t Àâòîð:Ðàäîñòèí Èâàíîâ \n");
- slowmotion("\t\t\t\t Ñïåöèàëíîñò:ÑÈÒ \n");
- slowmotion("\t\t\t\t Ãðóïà:VIa \n");
- slowmotion("\t\t\t\t Ôàêóëòåòåí íîìåð:17621764 \n");
- cout << "\n\n\n\n\n ";
- exit(0);
- default:system("cls"); system("color 40");
- cout << "\n\n\n\n\n\n\n\n";
- cout << "\n\t\t\t Âúçíèêíà ãðåøêà â ñèñòåìàòà! \n";
- slowmotion("\t\t\t\t Ìîëÿ îïèòàéòå îòíîâî!");
- Sleep(2000);
- }
- } while (welcome != 4);
- }
- void infoBG()
- {
- system("cls"); // Èç÷èñòâàíå íà åêðàíà
- char Bulgarian[10][100] = { { "\n\n\t Èíôîðìàöèÿ:" },{ " " } };
- for (int i = 0; i < 10; i++)
- {
- cout << Bulgarian[i] << endl;
- Sleep(1000);
- }
- }
- void infoEN()
- {
- system("cls"); // Èç÷èñòâàíå íà åêðàíà
- char English[10][100] = { { "\n\n\t Information:" },{ "" } };
- for (int i = 0; i < 10; i++)
- {
- cout << English[i] << endl;
- Sleep(1000);
- }
- }
- void infoGE()
- {
- system("cls"); // Èç÷èñòâàíå íà åêðàíà
- char German[10][100] = { { "\n\n\t Informationen:" },{ "" } };
- for (int i = 0; i < 10; i++)
- {
- cout << German[i] << endl;
- Sleep(1000);
- }
- }
- void Bulgarian() // ìåíþ íà Áúëãàðñêè åçèê
- {
- system("cls");
- int izbor;
- do
- {
- Benz benz; //object of class Benz
- BMW bmw, caller; //objects of class BMW
- system("color F2");
- system("mode 100,40");
- cout << "\n\n\n\n\n";
- cout << "\t ___________________________________________________________" << endl;
- cout << "\t | * * | Èíôîðìàöèÿ |" << endl;
- cout << "\t | * * | Ãàðàæà íà 'ÐÀÄÎ' âè ïðåäëàãà îòëè÷íàòà |" << endl;
- cout << "\t | * * | âúçìîæíîñò äà ïðîâåðèòå êîëêî å áúðçà |" << endl;
- cout << "\t | * * | êîëàòà âè. Âúâåäåòå ìîäåë, ãîäèíà, |" << endl;
- cout << "\t | * * | öåíà, ñêîðîñò è òåæåñò íà àâòîìîáèëà è ãî |" << endl;
- cout << "\t | * * | ñðàâíåòå ñ äðóã òàêúâ è íèå ùå âè êàæåì |" << endl;
- cout << "\t | _ __ | êîé å ïî-áúðç è ïî äîáúð ñïðÿìî âúâäåíèòå |" << endl;
- cout << "\t | |_) | _ | îò âàñ äàííè. Îïöèÿòà òóíèíã âè ïðåäîñòàâÿ |" << endl;
- cout << "\t | |__) |__| | ñìÿíà íà âúâåäåíàòà ñòîéíîñò çà ñêîðîñò |" << endl;
- cout << "\t |____________|______________________________________________|" << endl;
- cout << "\n\n";
- slowmotion("\t\t ***ÄÎÁÐÅ ÄÎØËÈ Â ÃÀÐÀÆÀ ÍÀ ÐÀÄÎ*** \n");
- cout << "\t\t ___________________________________________________________________________" << endl;
- cout << "\t\t| |" << endl;
- cout << "\t\t| ***************************** |" << endl;
- cout << "\t\t| * * |" << endl;
- cout << "\t\t| * * |" << endl;
- cout << "\t\t| * 1 : Âúâåäè ñòîéíîñòè * |" << endl;
- cout << "\t\t| * 2 : Òóíèíãîâàé * |" << endl;
- cout << "\t\t| * 3 : Ïðîâåðè ñêîðîñòòà * |" << endl;
- cout << "\t\t| * 4 : Èçâåäè ñòîéíîñòèòå * |" << endl;
- cout << "\t\t| * 5 : Êúì ìåíþòî ñ åçèê * |" << endl;
- cout << "\t\t| * 0 : Èçõîä * |" << endl;
- cout << "\t\t| * * |" << endl;
- cout << "\t\t| * * |" << endl;
- cout << "\t\t| ***************************** |" << endl;
- cout << "\t\t|___________________________________________________________________________|" << endl;
- cout << "\t\t\n Íàïðàâåòå èçáîð =>: ";
- cin >> izbor;
- switch (izbor)
- {
- case 1:setMembers(benz, bmw); break; ;
- case 2:Tuning(benz, bmw); break;
- case 3:checkSpeed(benz, bmw); break;
- case 4:getMembers(benz, bmw); break;
- case 5:language();
- case 0:
- cout << "\n\n\n\n\n";
- slowmotion("\t\t\t\t Áëàãîäàðÿ çà Âíèìàíèåòî! \n\n");
- slowmotion("\t\t\t\t Àâòîð:Ðàäîñòèí Èâàíîâ \n");
- slowmotion("\t\t\t\t Ñïåöèàëíîñò:ÑÈÒ \n");
- slowmotion("\t\t\t\t Ãðóïà:VIa \n");
- slowmotion("\t\t\t\t Ôàêóëòåòåí íîìåð:17621764 \n");
- cout << "\n\n\n\n\n ";
- exit(0);
- default:system("cls"); system("color 40");
- cout << "\n\n\n\n\n\n\n\n";
- cout << "\n\t\t\t\t Âúçíèêíà ãðåøêà â ñèñòåìàòà! \n";
- slowmotion("\t\t\t\t Ìîëÿ îïèòàéòå îòíîâî!");
- Sleep(2000);
- }
- getch();
- } while (izbor != 4);
- }
- void English() // ìåíþ íà Àíãëèéñêè åçèê
- {
- system("cls");
- int izbor;
- do
- {
- system("color 1f");
- system("mode 100,40");
- cout << "\n\n\n\n\n";
- cout << "\t ___________________________________________________________" << endl;
- cout << "\t | * * | Information |" << endl;
- cout << "\t | * * | Rado's garage offers you an excellent |" << endl;
- cout << "\t | * * | opportunity to check how fast your car is. |" << endl;
- cout << "\t | * * | Enter model, year, price, speed and |" << endl;
- cout << "\t | * * | weight of the car andand compare it |" << endl;
- cout << "\t | * * | to another one and we will tell you |" << endl;
- cout << "\t | __ | which of the two is faster and better |" << endl;
- cout << "\t | |_ |\\ | | than the data you have.The tuning option |" << endl;
- cout << "\t | |__ | \\| | allows you to change the speed entered |" << endl;
- cout << "\t |____________|______________________________________________|" << endl;
- cout << "\n\n";
- slowmotion("\t\t ***Welcome to Rado's garage*** \n");
- cout << "\t\t ____________________________________________________________________________" << endl;
- cout << "\t\t| |" << endl;
- cout << "\t\t| ***************************** |" << endl;
- cout << "\t\t| * * |" << endl;
- cout << "\t\t| * * |" << endl;
- cout << "\t\t| * 1 : Enter values. * |" << endl;
- cout << "\t\t| * 2 : Tuning. * |" << endl;
- cout << "\t\t| * 3 : Check values. * |" << endl;
- cout << "\t\t| * 4 : Show results. * |" << endl;
- cout << "\t\t| * 5 : Language menu. * |" << endl;
- cout << "\t\t| * 0 : Exit. * |" << endl;
- cout << "\t\t| * * |" << endl;
- cout << "\t\t| * * |" << endl;
- cout << "\t\t| ***************************** |" << endl;
- cout << "\t\t|____________________________________________________________________________|" << endl;
- cout << "\t\t\n Make your choice =>: ";
- cin >> izbor;
- switch (izbor)
- {
- case 1:
- case 2:
- case 3:
- case 4:
- case 5:language();
- case 0:
- cout << "\n\n\n\n\n\n\n\n";
- slowmotion("\t\t\t\t Áëàãîäàðÿ çà Âíèìàíèåòî! \n\n");
- slowmotion("\t\t\t\t Àâòîð:Ðàäîñòèí Èâàíîâ \n");
- slowmotion("\t\t\t\t Ñïåöèàëíîñò:ÑÈÒ \n");
- slowmotion("\t\t\t\t Ãðóïà:VIa \n");
- slowmotion("\t\t\t\t Ôàêóëòåòåí íîìåð:17621764 \n");
- cout << "\n\n\n\n\n ";
- exit(0);
- default:system("cls"); system("color 40");
- cout << "\n\n\n\n\n\n\n\n";
- cout << "\n\t\t\t\t ERROR Bad Input! \n";
- slowmotion("\t\t\t\t Please try again!");
- Sleep(2000);
- }
- getch();
- } while (izbor != 4);
- }
- void German() // ìåíþ íà Íåìñêè åçèê
- {
- system("cls");
- int izbor;
- do
- {
- system("color 06");
- system("mode 100,40");
- cout << "\n\n\n\n\n";
- cout << "\t ___________________________________________________________" << endl;
- cout << "\t | * * | Informationen |" << endl;
- cout << "\t | * * | Die Garage von 'RADO' bietet Ihnen die |" << endl;
- cout << "\t | * * | ausgezeichnete Moglichkeit zu uberprufen, |" << endl;
- cout << "\t | * * | wie schnell es ist Dein Auto.Geben Sie |" << endl;
- cout << "\t | * * | Modell, Jahr, Preis, Geschwindigkeit und |" << endl;
- cout << "\t | * * | Gewicht des Autos und vergleichen Sie es mit |" << endl;
- cout << "\t | __ __ | einem anderen und wir werden Lassen Sie uns |" << endl;
- cout << "\t | | _ |_ | sagen, wer schneller und besser ist als |" << endl;
- cout << "\t | |__| |__ | die Daten, die Sie eingegeben haben. |" << endl;
- cout << "\t |____________|______________________________________________|" << endl;
- cout << "\n\n";
- slowmotion("\t\t ***Willkommen in Rados Garage*** \n");
- cout << "\t\t ____________________________________________________________________________" << endl;
- cout << "\t\t| |" << endl;
- cout << "\t\t| ****************************** |" << endl;
- cout << "\t\t| * * |" << endl;
- cout << "\t\t| * * |" << endl;
- cout << "\t\t| * 1 : Werte eingeben. * |" << endl;
- cout << "\t\t| * 2 : Tuning. * |" << endl;
- cout << "\t\t| * 3 : Werte uberprufen. * |" << endl;
- cout << "\t\t| * 4 : Ergebnisse anzeigen.* |" << endl;
- cout << "\t\t| * 5 : Sprachmenü. * |" << endl;
- cout << "\t\t| * 0 : Ausfahrt. * |" << endl;
- cout << "\t\t| * * |" << endl;
- cout << "\t\t| * * |" << endl;
- cout << "\t\t| ***************************** |" << endl;
- cout << "\t\t|____________________________________________________________________________|" << endl;
- cout << "\t\t\n Treffen Sie eine Wahl =>: ";
- cin >> izbor;
- switch (izbor)
- {
- case 1:
- case 2:
- case 3:
- case 4:
- case 5:language();
- case 0:
- cout << "\n\n\n\n\n";
- slowmotion("\t\t\t\t Áëàãîäàðÿ çà Âíèìàíèåòî! \n\n");
- slowmotion("\t\t\t\t Àâòîð:Ðàäîñòèí Èâàíîâ \n");
- slowmotion("\t\t\t\t Ñïåöèàëíîñò:ÑÈÒ \n");
- slowmotion("\t\t\t\t Ãðóïà:VIa \n");
- slowmotion("\t\t\t\t Ôàêóëòåòåí íîìåð:17621764 \n");
- cout << "\n\n\n\n\n ";
- exit(0);
- default:system("cls"); system("color 40");
- cout << "\n\n\n\n\n\n\n\n";
- cout << "\n\t\t\t\t Ein Fehler im System ist aufgetreten! \n";
- slowmotion("\t\t\t\t Bitte versuchen Sie es erneut!");
- Sleep(2000);
- }
- getch();
- } while (izbor != 4);
- }
- };
- int main()
- {
- PlaySound("welcome_audio.wav", NULL, SND_ASYNC);
- setlocale(LC_ALL, "bulgarian");
- system("title CAR TUNING");
- system("color 3f");
- char a = 177, b = 219;
- cout << "\n\n\n\n\n";
- cout << "\t\t\t**********************************" << endl;
- cout << "\t\t\t* *" << endl;
- cout << "\t\t\t* Loading ... *" << endl;
- cout << "\t\t\t* *" << endl;
- cout << "\t\t\t**********************************" << endl << endl;
- Sleep(1000);
- SetConsoleOutputCP(850);
- for (int i = 0; i <= 57; i++) cout << a;
- cout << "\r\r";
- cout << "\t\t\t";
- for (int i = 0; i <= 33; i++)
- {
- // system("color 8b");
- cout << b;
- Sleep(100);
- }
- SetConsoleOutputCP(1251);
- system("cls");
- cout << "\n\n\n\n\n";
- cout << "\t\t\t**********************************" << endl;
- cout << "\t\t\t* *" << endl;
- cout << "\t\t\t* Finish! *" << endl;
- cout << "\t\t\t* The program is ready to use! *" << endl;
- cout << "\t\t\t* *" << endl;
- cout << "\t\t\t**********************************" << endl << endl;
- Sleep(2000);
- language();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement