#include <iostream>
#include <string>
int main( void )
{
using std::cout;
using std::cin;
using std::string;
string playerName;
string playerSword;
int playerMoney = 30;
int woodensword = 5;
int stonesword = 10;
int ironsword = 15;
int gold = 10;
int iron = 5;
cout << "You are a knight in the 1600s,\n"
<< "You see a nearby weapon shop that sells:\n"
<< "Wooden Swords, Stone Swords and Iron Swords.\n\n"
<< "You walk in the shop, and notice the prices for each type\n"
<< " of sword." << "You have 3 gold, and the prices for the swords are such:\n"
<< "Wooden Sword: 5 coins\n"
<< "Stone Sword: 10 coins\n"
<< "Iron Sword: 15 coins\n";
cout << "1 gold is 10 coins\n"
<< "What would you like to buy? (StoneSword, WoodenSword or IronSword)\n";
cin >> playerSword;
if (playerSword = "WoodenSword")
{
playerMoney = playerMoney - woodensword;
cout << "You bought a Wooden Sword!\n" << "You now have the equivlent gold of " << playerMoney << " coins.";
}
elseif (playerSword = "StoneSword")
{
playerMoney = playerMoney - stonesword;
cout << "You bought a Stone Sword!\n" << "You now have the equivlent gold of " << playerMoney << " coins.";
}
else (playerSword = "IronSword");
{
playerMoney = playerMoney - ironsword;
cout << "You bought an Iron Sword!\n" << "You now have the equivlent gold of " << playerMoney << " coins.";
}
cout << "Thank you for buying the sword!\n";
cout << "Have a nice day.";
return 0;
}
i didnt mention this but im new to c++
i have a bit of experience in java and python