473,322 Members | 1,566 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,322 software developers and data experts.

Please could someone fix my code

Expand|Select|Wrap|Line Numbers
  1. #include <iostream>
  2.  
  3. void sizeYear(double,double,double ,int);
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.  
  10.    double population;
  11.    double birthRate;
  12.    double deathRate;
  13.  
  14.    int numYears;
  15.  
  16.    cout << "Please enter a Population" << endl;
  17.    cin >> population;
  18.  
  19.    cout << "Please enter the Birth rate" << endl;
  20.    cin >> birthRate;
  21.  
  22.    cout << "Please enter a Death rate" << endl;
  23.    cin >> deathRate;
  24.  
  25.    cout << "Please enter the number of years to display" << endl;\
  26.    cin >> numYears;
  27.  
  28.    sizeYear(population,birthRate,deathRate,numYears);
  29.  
  30.    while (numYears = 0)
  31.    {
  32.       if (numYears>0) population=1;
  33.       else
  34.          population=0;
  35.    }
  36.    return 0;
  37. }


ok this is what i have came up with so far it should work but i have some errors could someone twink it a little
Apr 25 '07 #1
3 1537
g2.obj : error LNK2019: unresolved external symbol "void __cdecl sizeYear(double,double,double,int)" (?sizeYear@@YAXNNNH@Z) referenced in function _main


that is the only error i am getting
Apr 25 '07 #2
Ganon11
3,652 Expert 2GB
Have you included a definition of sizeYears() yet?
Apr 25 '07 #3
ilikepython
844 Expert 512MB
Expand|Select|Wrap|Line Numbers
  1.    while (numYears = 0)
  2.    {
  3.       if (numYears>0) population=1;
  4.       else
  5.          population=0;
  6.    }
  7.    return 0;
  8. }
ok this is what i have came up with so far it should work but i have some errors could someone twink it a little
You have while numYears = 0;. You want while numYears == 0;.
Also, I don't really get what you are trying to do with that loop. You are saying loop while numYears is equal to 0. Then, you check if numYears is greater than 0. It can't be both, so that if will never evaluate true. Also, the loop will run forever because you never change numYears so it will always be equal to 0.
Apr 25 '07 #4

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

Similar topics

13
by: Chiller | last post by:
I'm now getting close to finishing my Distance class. In the code below I have included a number of overload operators that test for equality etc. I've also added more code in the TEST_DISTANCE...
8
by: kittykat | last post by:
Hi, could someone please check my code? its asking the user to enter 3 letters, and check to see if these letters exist in the text file. i know ive done something wrong. can someone fix my code...
5
by: TrvlOrm | last post by:
HI There, I have been struggling with JavaScript code for days now, and this is my last resort! Please help... I am trying to create a JavaScript slide show with links for Next Slide,...
11
by: milkyway | last post by:
Hello, I have an HTML page that I am trying to import 2 .js file (I created) into. These files are: row_functions.js and data_check_functions.js. Whenever I bring the contents of the files into...
5
by: jalkadir | last post by:
Can someone please explain to me why, if I type 'Ni(ALT-164)A' at the windows prompt, I get 'Niña', but if my program does this: int main(){ std::string str("Niña"); std::cout << str <<...
59
by: Alan Silver | last post by:
Hello, This is NOT a troll, it's a genuine question. Please read right through to see why. I have been using Vusual Basic and Classic ASP for some years, and have now started looking at...
1
by: Sean128 | last post by:
Hi, I hope someone can help me - this seems like it should be a really simple problem but I've been having trouble trying to solve it all week. I have hosted my website on a Linux server in 1...
1
by: Sean128 | last post by:
Hi, I hope someone can help me - this seems like it should be a really simple problem but I've been having trouble trying to solve it all week. I have hosted my website on a Linux server in 1...
6
by: fido19 | last post by:
Once upon a time, there lived a chimpanzee called Luycha Bandor (aka Playboy Chimp). Luycha was unhappily married to Bunty Mona, a short but cute little lady chimp. Luycha was tall and handsome –...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.