473,398 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

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?

Expand|Select|Wrap|Line Numbers
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. using std::cout;
  7.       using std::cin;
  8.       using std::string;
  9.  
  10.  
  11. int main()
  12.  
  13. {
  14.  const int GOLD_PIECES = 700;
  15.  Int friends, adventurers, killed, survivors, location, job;
  16.      string leader;
  17.  
  18.             cout << "Welcome to Darksoft's Lost Fortune!"/n/n*;
  19.             cout << "Please enter some of your details to start";
  20.  
  21.             cout << "What is your name?";
  22.             cin >> leader;
  23.             cout << "Enter your best friends name";
  24.             cin >> friends;
  25.             cout << "Please enter a number";
  26.             cin >> adventurers;
  27.             cout << "Please enter another number but smaller than the first!";
  28.             cin >> killed;
  29.             cout << "What town/city do you live in?";
  30.             cin >> location;
  31.             cout << "Please enter a job";
  32.             cin >> job;
  33.             cout << "Please enter a colour";
  34.             cin >> colour;
  35.  
  36.             survivors = adventurers - killed;
  37.  
  38.             //Tell the story script
  39.  
  40.             cout << "\n A brave group of " << adventurers << " set out on the journey! ";
  41.                  cout << "-They weren't soldiers or anything, they were only " << job << "on a mission! ";
  42.                cout << "The leader was " << leader << ;
  43.             cout << "\n "So they set off in their big " << colour << " ship that was absolute massive!";
  44.             cout << "The army of " << adventurers << "Then arrived in " << location << "and saw the opponent";
  45.             cout << "They battled for ages and ages, until the enemies army of " << killed << "were completely destroyed!";
  46.             cout << "Their were only " << survivors << "from " << leader << "'s army but they did a good job!"
  47.             cout << "The day was saved and now so was " << location <<;
  48.  
  49.     system("PAUSE");
  50.     return EXIT_SUCCESS;
  51. }
Dec 2 '06 #1
2 1275
horace1
1,510 Expert 1GB
your main problem is in the line
Expand|Select|Wrap|Line Numbers
  1.  Int friends, adventurers, killed, survivors, location, job;
  2.  
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
Dec 2 '06 #2
Ganon11
3,652 Expert 2GB
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.
Dec 2 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Greener | last post by:
Hi, I need help badly. Can you do client-side programming instead of server-side to capture the Browser type info? If this is the case, what's wrong with the following? <script...
5
by: tin | last post by:
<script language="Javascript"> <!-- function apri (theURL,winName,features){ window.open (theURL,winName,features); var a=null; oldwindow = window.self; oldwindow.opener = window.self;...
6
by: Rtritell | last post by:
Please can you find out what's wrong, fix the script and tell me what was wrong. Im just beginning <html> <head> <title>Random Mad Lib!</title> <script language="JavaScript"> <!-- Hide
17
by: Paul | last post by:
HI! I get an error with this code. <SCRIPT language="JavaScript"> If (ifp==""){ ifp="default.htm"} //--></SCRIPT> Basicly I want my iframe to have a default page if the user enters in...
4
by: Paul | last post by:
HI! I have a script that does not seem to work. can someone tell me what I am doing wrong here? <script language="JavaScript"> function firefoxautofix(){ parent.window.resizeBy(-1,-1)...
2
by: Miguel Dias Moura | last post by:
Hello, i want to open a new window when a button is clicked. I am working in ASP.net / VB. However my code is not working. This is my Script Code: <script runat="server"> Private Sub...
8
by: Midnight Java Junkie | last post by:
Dear Colleagues: I feel that the dumbest questions are those that are never asked. I have been given the opportunity to get into .NET. Our organization has a subscription with Microsoft that...
6
by: plemon | last post by:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta...
3
by: Siong.Ong | last post by:
Dear all, my PHP aims to update a MySQL database by selecting record one by one and modify then save. Here are my PHP, but I found that it doesnt work as it supposed to be, for example, when...
2
by: Tarik Monem | last post by:
OK! I've gone through a few tutorials and I cannot understand what I'm doing wrong casting_registration.php <table> <tr> <td> <form enctype="multipart/form-data" action="thankyou.php"...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.