Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <fstream>
- #include "Automobil.h"
- using namespace std;
- void Automobil::upisiInformacije(string putanja){
- ofstream citanjeFajla;
- citanjeFajla.open(putanja,ios_base::app);
- citanjeFajla<<this->getMarka()<<" " <<this->getModel()<<this->getGodinaProizvodnje()<<" " <<this->getBrojRegistracije()<<" " <<this->getDatumRegistracije() <<" "<<this->getSnagaMotora()<<" "<<this->getBrojVrata()<<" "<<this->getBoja()<<" "<<this->getBrojSasije()<<endl;
- citanjeFajla.close();
- }
- void Automobil::ispisiIzvestaj(string putanja){
- ifstream ispisivanjeFajla;
- ispisivanjeFajla.open(putanja);
- if(ispisivanjeFajla.is_open()){
- string red;
- while(getline(ispisivanjeFajla,red)){
- cout<< red <<endl;
- }
- }
- ispisivanjeFajla.close();
- }
- void Automobil::print(){
- cout<<this->getMarka()<<" " <<this->getModel()<<this->getGodinaProizvodnje()<<" " <<this->getBrojRegistracije()<<" " <<this->getDatumRegistracije() <<" "<<this->getSnagaMotora()<<" "<<this->getBrojVrata()<< " "<<this->getBoja()<<" "<<this->getBrojSasije()<<endl;
- }
- void Automobil:: setSnagaMotora(int snagaMotora){
- this->snagaMotora = snagaMotora;
- }
- void Automobil::setBrojVrata(int brojVrata){
- this->brojVrata = brojVrata;
- }
- void Automobil::setBrojSasisje(int brojSasisje){
- this->brojSasije = brojSasisje;
- }
- void Automobil::setBoja(string boja){
- this->boja = boja;
- }
- int Automobil::getSnagaMotora(){
- return this->snagaMotora;
- }
- int Automobil::getBrojVrata(){
- return this->brojVrata;
- }
- int Automobil::getBrojSasije(){
- return this->brojSasije;
- }
- string Automobil::getBoja(){
- return this->boja;
- }
- Automobil::Automobil(){
- }
- Automobil::Automobil(string marka, string model, int godinaProizvodnje, string brojRegistracije, string datumRegistracije, int snagaMotora, int brojVrata, int brojSasije, string boja) : Vozilo(marka,model,godinaProizvodnje), Registracija(brojRegistracije, datumRegistracije){
- this->snagaMotora = snagaMotora;
- this->brojVrata = brojVrata;
- this->brojSasije = brojSasije;
- this->boja = boja;
- }
Advertisement
Add Comment
Please, Sign In to add comment