User Profile
Collapse
-
Unfortunately, that was not the only problem though. It still doesnt work. -
-
I'm using visual basic. It compiled, but wouldn't complete the code, it would just break off.
But I am having trouble with what you are saying, how should I go about declaring the low and high values?Leave a comment:
-
merge sort
I am trying to generate a random vector of integers and sort them using merge sort.
I am having trouble with the code. It is long, but I would appreciate if someone could take a look at it and see if the can help me, I've been working on it for days and am completely stuck.
When I run the program, it just stops at the point where I call the mergesort. I believe the problem may be in the merge split, because when I cout the values... -
problem with classes
I am working on a project that inputs stock information from files, then outputs the information when the customer is called upon. I am doing pretty good, but am stuck. This is what I have.
...Code:for (int k = 0; k < namevector.size(); k++){ //namevector is a vector of type otherfile.close(); customer(defined as a class) otherfile.clear(); otherfile.open(namevector[k].getname().c_str()); -
Thanks for your help. What is MyObject, that is what I am trying to put into the vector, correct?Leave a comment:
-
would it possibly look something like this:
...Code:for(int j = 0; j<namevector.size(); j++){ otherfiles.open(namevector[j].c_str()); while(!otherfiles.eof()){ otherfiles >> symbol >> numshare >> price; customerstock.setsymbol(symbol); customerstock.setnumshare(numshare); customerstock.setprice(price); if (!otherfiles.eof()){ stockvector.push_back(customerstock);Leave a comment:
-
create a vector of a class
I'm working on a program that reads in from a file a list of customers and puts them in a vector. I did that. Next, there is a file for each customer that I put in this vector. I need to open the file, and "assign the data to a new instance of the class in the vector." I don't really know what this means. I have a class of stocks, where a stock consists of three arguements, a symbol, amount of stock and price. My class looks like this:... -
reading and outputting a return
Hi,
I wrote a program that reads a file, by building up text one character at a time, looks for keywords, and replaces them if they are found. I am working on building up my output. The words come out right, and I added the punctuation back in ok. The last step is, if there is a return in the original text that started a new line, then I need to start a new line in the output. I tried,
if (text[j] == '\n'){... -
Remark if word not found in text
I wrote a program that searched a file word by word, looking for keywords from another file that needed to be replaced in the first file. I did this, but I need to state an error message if one of the keyword was never found.
This is what i tried,
[CODE=cpp] for (int i = 0; i < count; i++){
if (potter.eof() && (text != word[i])){
cout << endl << endl;
cout << w... -
You're right, I can't believe I didn't think of that, it works, thank you very much.Leave a comment:
-
outputting text character by character
Hi,
I am writing a code that requires me to search for words within a text document. I had to build up words one character at a time in order to ignore punctuation when I search for the words. I did this without a problem. But now I am working on building the output again. This is the code I have that outputs the text. Flag is 1 when a keyword is found and substituted. Flag 0 is when no word is found, and it outputs the original word. If... -
Ok, sorry for the confusion. The one file is just a text file, a short story that I have to search for words in. The other file, is another text file, that looks like this:
Harry Harold
scar mark
mom mum
magic mystery
I Me
The first column is the words I'm looking for, the second column is the word I need to replace the first column with.
If you could get me started I would greatly...Leave a comment:
-
Search files for word replacement
Hi,
I'm working on a project that searches one file for words and their replacements found in another file. I'm stuck at the beginning. I think, I need to put the words in the file in an array so I can search the array, but I'm not sure how to do this. If someone could help me get started I can work on the rest of the code.
Thanks
No activity results to display
Show More
Leave a comment: