Facebook
From Jittery Hog, 6 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 238
  1. #pragma once
  2. #include <vector>
  3. #include <iostream>
  4. #include <string>
  5. #include <math.h>
  6. #include <conio.h>
  7. #include <fstream>
  8.  
  9. class Imp
  10. {
  11. public:
  12.         std::string Name;
  13.         Imp(std::string c)
  14.         {
  15.                 Name = c;
  16.         }
  17.         virtual void DisplayName();
  18. };
  19.  
  20. const std::vector<std::string> explode(const std::string& s, const char& c);
  21. class Asset:public Imp
  22. {
  23. private:
  24.         double Value;
  25.         double ProfitPercentPerYear;
  26.         double FlatProfitPerYear;
  27. public:
  28.          int ID;//1- Lokata 2- Konto Emerytalne 3- nieruchomosc
  29.         double SimulateProfit(int Years);
  30.         void DisplayName();
  31.         double GetValue();
  32.         std::string GetName();
  33.         double GetProfitPercent();
  34.         double GetFlatProfit();
  35.         void SetValue(double v);
  36.         void SetName(std::string N);
  37.         void SetProfitPercent(double PerCent);
  38.         void SetFlatProfit(double Flat);
  39.         void SaveState(std::fstream& File);
  40.         Asset& operator +=(const Asset& Modified);
  41.         Asset& operator -=(const Asset& Modified);
  42.         Asset(double PerCent, double Flat, double value,std::string c,int id):Imp(c)
  43.         {
  44.                 this->Value = value;
  45.                 this->ProfitPercentPerYear = PerCent;
  46.                 this->FlatProfitPerYear = Flat;
  47.                 this->ID = id;
  48.         }
  49.         Asset():Imp("")
  50.         {
  51.                 this->Value = 0;
  52.                 this->ProfitPercentPerYear = 0;
  53.                 this->FlatProfitPerYear = 0;
  54.                 this->ID = 0;
  55.         }
  56. };