i keep getting the expected primary-expression before '<<' error on lines 84-88 if someone could help me figure that out that would be great and as this is my first program i am always open to suggestions on how to improving my coding skills.
#include <cstdlib>
#include <iostream>
#include <string>
usingnamespace std;
int main()
{
string yourname;
string input;
//Sets charcter name//
cout << "Welcome, What is your name?" << endl;
cout << ">";
getline(cin, yourname);
cout << "I see your name is " << yourname << endl;
cout << "Well " << yourname << " all of Middle Earth is in chaos and we need your help." << endl;
//Sets character class//
double Strength; //Declare Strength//
double Health; //Declare Health//
double Defense; //Declare Defense//
double Mana; //Declare Mana//
double Speed; //Declare Speed//
int user_answer;
//Gives you a choice of class to be trained as//
cout << "What would you like to be trained as: " << endl;
cout << endl;
cout << " 1) Warrior\n";
cout << " 2) Rogue\n";
cout << " 3) Mage\n";
cout << endl;
cin >> user_answer;
cout << endl;
switch (user_answer)
{
case 1: //Sets stats for a Warrior//
Strength = 10;
Health = 20;
Defense = 10;
Mana = 5;
Speed = 5;
cout << "I see you would like to be a warrior." << endl;
cout << "Strength: " << Strength << endl;
cout << " Health: " << Health << endl;
cout << " Defense: " << Defense << endl;
cout << " Mana: " << Mana << endl;
cout << " Speed: " << Speed << endl;
break;
case 2: //Sets stats for a Rogue//
Strength = 10;
Health = 15;
Defense = 5;
Mana = 5;
Speed = 15;
cout << "The road to becoming a rogue is a tough one I wish you the best of luck." << endl;
cout << "Strength: " << Strength << endl;
cout << " Health: " << Health << endl;
cout << " Defense: " << Defense << endl;
cout << " Mana: " << Mana << endl;
cout << " Speed: " << Speed << endl;
break;
case 3: //Sets stats for a mage//
Strength = 5;
Health = 10;
Defense = 5;
Mana = 15;
Speed = 15;
cout << "ahh another wizard we always love to have a few more of you around" << endl;
cout << "Strength: " << Strength << endl;
cout << " Health: " << Health << endl;
cout << " Defense: " << Defense << endl;
cout << " Mana: " << Mana << endl;
cout << " Speed: " << Speed << endl;
break;
default:
cout << "I am sorry but that was not one of your choices" << endl;
break;
}
//Storyline//
cout << endl;
cout << "You have now choosen your class so it is time to start your training."; << endl;
cout << "I have had a problem with rats in my basement your task is to get rid of them."; << endl;
cout << "You creep down into the basement, you step off the bottom step into a couple "; << endl;
cout << "inches of water and can smell decay in the air. Out of the unlit corner a "; << endl;
cout << "giant rat the size of a rotweiler charges at you.";
cout << endl;
cout << endl;
//Gives you your first choice in the game//
string choice1;
cout << "Do you ";
cout << endl;
cout << endl;
cout << "[1]Stay and fight the rat" << endl;
cout << "[2]Flee back up the stairs" << endl;
///////////////////////////Combat System////////////////////////////////////////
if (choice1=="1")
{
//Setting Variables//
double GiantRatHealth = 5;
double GiantRatDamage = 1;
while (GiantRatHealth >=1 && GiantRatHealth >=1)
{
cout << "The giant rat charges you and bites you on the ankle" << endl;
cout << "Your Health: " << Health << endl;
cout << "Giant rats Health: " << GiantRatHealth << endl;
}
system("PAUSE");
return 0;
}
}
cout << "You have now choosen your class so it is time to start your training."; << endl;
cout << "I have had a problem with rats in my basement your task is to get rid of them."; << endl;
cout << "You creep down into the basement, you step off the bottom step into a couple "; << endl;
cout << "inches of water and can smell decay in the air. Out of the unlit corner a "; << endl;