Original Post
Hi there, i'm a total newb with programming and I'm following along in this book. At the end of chapter one it has me write this program and I keep getting an error saying "Adventurers is being used without being initialized. Can someone please help or explain? Thanks
//Lost Fortune
//A Personalizwd adventure
#include
#include
using std::cout;
using std::cin;
using std::endl;
using std::string;
int main()
{
const int GOLD_PIECES = 900;
int adventurers, killed, survivors;
string leader;
//get the information
cout << "Welcome to Lost Fortune\n\n";
cout << "Please enter the follow for your personalized adventure\n";
cout<<"Enter a number: ";
cin >> killed;
survivors = adventurers - killed;
cout<< "Enter you last name: ";
cin>>leader;
//tell the story
cout<<"\n A Brave group of"< cout<<"- in search of the lost treasure of the Ancient Dwarves.";
cout<<"The group was led by that legendary rogue,"<
cout<<"\nAlong the way, a band of marauding ogres ambushed the party.";
cout<<"All fought bracely under the command of"< cout<<", and the ogres were defeated but at a cost.";
cout<<"Of the adventurers, "< cout<<"leaving just"< cout<<"\nThe party was about to give up all hope.";
cout<<"But while laying the deceased to rest.";
cout<<"they stumbled upon the buried fortune";
cout<<"So the adventurers split"< cout< cout<<"pieces to keep things fair of course.\n";
return 0;
}
//Lost Fortune
//A Personalizwd adventure
#include
#include
using std::cout;
using std::cin;
using std::endl;
using std::string;
int main()
{
const int GOLD_PIECES = 900;
int adventurers, killed, survivors;
string leader;
//get the information
cout << "Welcome to Lost Fortune\n\n";
cout << "Please enter the follow for your personalized adventure\n";
cout<<"Enter a number: ";
cin >> killed;
survivors = adventurers - killed;
cout<< "Enter you last name: ";
cin>>leader;
//tell the story
cout<<"\n A Brave group of"<
cout<<"The group was led by that legendary rogue,"<
cout<<"\nAlong the way, a band of marauding ogres ambushed the party.";
cout<<"All fought bracely under the command of"<
cout<<"Of the adventurers, "<
cout<<"But while laying the deceased to rest.";
cout<<"they stumbled upon the buried fortune";
cout<<"So the adventurers split"<
return 0;
}