What is wrong with this script?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jakeruston
    New Member
    • Oct 2006
    • 10

    #1

    What is wrong with this script?

    Hi,

    I have coded this and it is coming up with hundreds of errors. What is wrong with this anyway?

    Code:
    #include <iostream>
    #include <string>
    
    using namespace std;
    
    using std::cout;
          using std::cin;
          using std::string;
    
                
    int main()
    
    {
     const int GOLD_PIECES = 700;
     Int friends, adventurers, killed, survivors, location, job;
         string leader;
                
                cout << "Welcome to Darksoft's Lost Fortune!"/n/n*;
                cout << "Please enter some of your details to start";
                
                cout << "What is your name?";
                cin >> leader;
                cout << "Enter your best friends name";
                cin >> friends;
                cout << "Please enter a number";
                cin >> adventurers;
                cout << "Please enter another number but smaller than the first!";
                cin >> killed;
                cout << "What town/city do you live in?";
                cin >> location;
                cout << "Please enter a job";
                cin >> job;
                cout << "Please enter a colour";
                cin >> colour;
                
                survivors = adventurers - killed;
                
                //Tell the story script
                
                cout << "\n A brave group of " << adventurers << " set out on the journey! ";
                     cout << "-They weren't soldiers or anything, they were only " << job << "on a mission! ";
                   cout << "The leader was " << leader << ;
                cout << "\n "So they set off in their big " << colour << " ship that was absolute massive!";
                cout << "The army of " << adventurers << "Then arrived in " << location << "and saw the opponent";
                cout << "They battled for ages and ages, until the enemies army of " << killed << "were completely destroyed!";
                cout << "Their were only " << survivors << "from " << leader << "'s army but they did a good job!"
                cout << "The day was saved and now so was " << location <<;
                
        system("PAUSE");
        return EXIT_SUCCESS;
    }
  • horace1
    Recognized Expert Top Contributor
    • Nov 2006
    • 1510

    #2
    your main problem is in the line
    Code:
     Int friends, adventurers, killed, survivors, location, job;
    Int should have a small i - the error here means that the variables are then undefined in the remainder of the program which generates lots of error messages

    Comment

    • Ganon11
      Recognized Expert Specialist
      • Oct 2006
      • 3651

      #3
      Also, you should consider changing some of these variables to strings - your name, for instance, is not a number and couldn't be held in an integer variable.

      Comment

      Working...