Type: Posts; User: elephant7
Search took 0.01 seconds.
Okay I think I got it to work, if you wouldn't mind checking over the insertion sort function:
using namespace std;
The selection and bubble sorts are working with this code below, but I couldn't figure out how to change the insertion sort to work properly. I tried making int current to Population current, but it...
Okay thank you, but it is still looping for some reason:
using namespace std;
const string filename = "population.csv";
So I tried this:
minvalue = data[startscan].pop;
data[startscan] = data[minindex];
data[minindex].pop = minvalue;
and it's still not working
temp = a;
a = b;
b = temp;
I can't figure out what the problem is, I tried using the debugger and didn't have any luck.
I tried that and now it says : "warning C4244: '=' : conversion from 'double' to 'int', possible loss of data"
So I changed :
Now it runs, but...
The code still isn't working. It now says: "error C2440: '=' : cannot convert from 'Population' to 'int' " on this line: "minvalue = data[startscan];"
Thank you for your help. I haven't used vectors very much, is there another way of doing that part?
Here is my revised code:
(I'm still having issues, it says that there is a mismatch in formal...
Thank you for your help. This assignment is past due, but I am just trying to understand it for future assignments. I updated my code with your advice, but am unsure how to do the array part.
I need some help with this program using the selection, insertion, and bubble sorts. The program needs to be able to do the following:
1. Create an array of 1000 population records when the array...
April 23rd, 2014, 11:40 AM
No, I'm not sure what order to place each line to make it work properly. I've tried moving it around and have had no luck.
April 23rd, 2014, 11:17 AM
I removed the replication of the lines that read from the file and kept them within the while loop and I'm still not getting the correct output. Here are the changes I made.
April 22nd, 2014, 10:18 PM
I was able to get some of it working properly but still need help in some spots, which I've marked with comments.
If you could look over it and let me know if I'm on the right track, that would be...
April 22nd, 2014, 08:05 PM
I'm not even sure where these cout statements should go or if I have them in the correct spot..
cout << " is being added" << endl;
cout << "The hashed location is " << hashFunc(movie) << endl;
April 22nd, 2014, 06:05 PM
the program runs but the output is all jumbled up and not displaying in the correct format that the teacher required.
This is what my output looks like if: ( I know I don't have it coded correctly...
April 22nd, 2014, 04:30 PM
I'm hoping to get some help with a few things for this homework assignment. I have included the assignment requirements below along with the my code so far. I am having trouble getting the cout...
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.