Skip to content
Permalink
af69d057cb
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
87 lines (57 sloc) 1.26 KB
#include <string>
#include <iostream>
using namespace std;
class weapons
{
private:
int damage,durability;
string background, name;
public:
weapons(int x, int y, string z) {
damage = x;
durability = y;
name = z;
}
void setDamage(int _damage)
{
damage = _damage;
}
int getDamage()
{
return damage;
}
void setDurability(int _durability)
{
durability = _durability;
}
int getDurability()
{
return durability;
}
void setBackground(string _background)
{
background = _background;
}
string getBackground()
{
return background;
}
string setname(string _name)
{
name = _name;
}
string getName()
{
return name;
}
};
#include "project.h"
#include <iostream>
using namespace std;
int main()
{
weapons swordObj(100, 50, "katana");
cout << swordObj.getDamage() << endl;
cout << swordObj.getDurability()<<endl;
cout << swordObj.getName()<<endl;
}