Advertisement
YourElectricityBill

S.T.A.L.K.E.R. Test C++

Jan 16th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.34 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4.  
  5. std::vector<std::string> StalkerNames;
  6. std::vector<std::string> StalkerSurnames;
  7.  
  8. class Stalker {
  9.     public:
  10.     Stalker()
  11.     {
  12.         HP = 100;
  13.     }
  14.     void setParameters(std::string &setName, std::string &setSurname, std::string &setFaction, std::string &setArmor)
  15.     {
  16.         Name = setName;
  17.         Surname = setSurname;
  18.         Faction = setFaction;
  19.         Armor = setArmor;
  20.     }
  21.     int getHP()
  22.     {
  23.         return HP;
  24.     }
  25.     std::string getName()
  26.     {
  27.         return Name;
  28.     }
  29.     std::string getSurname()
  30.     {
  31.         return Surname;
  32.     }
  33.     std::string getFaction()
  34.     {
  35.         return Faction;
  36.     }
  37.     std::string getArmor()
  38.     {
  39.         return Armor;
  40.     }
  41.     private:
  42.     int HP;
  43.     std::string Name;
  44.     std::string Surname;
  45.     std::string Faction;
  46.     std::string Armor;
  47.    
  48. };
  49. int main()
  50. {
  51.     Stalker Player;
  52.     std::string PlayerName;
  53.     std::string PlayerSurname;
  54.     std::string PlayerFaction = "Loner";
  55.     std::string PlayerArmor = "Kurtka";
  56.     std::cin >> PlayerName >> PlayerSurname;
  57.     Player.setParameters(PlayerName, PlayerSurname, PlayerFaction, PlayerArmor);
  58.     std::cout << "Name: " << Player.getName() << std::endl;
  59.     std::cout << "Surname: " << Player.getSurname() << std::endl;
  60.     std::cout << "HP: " << Player.getHP() << std::endl;
  61.     std::cout << "Faction: " << Player.getFaction() << std::endl;
  62.     std::cout << "Armor: " << Player.getArmor() << std::endl;
  63.     return 0;
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement