User Profile

Collapse

Profile Sidebar

Collapse
Sarahger9
Sarahger9
Last Activity: Dec 5 '07, 09:45 PM
Joined: Oct 4 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Sarahger9
    replied to merge sort
    in C
    Unfortunately, that was not the only problem though. It still doesnt work.
    See more | Go to post

    Leave a comment:


  • Sarahger9
    replied to merge sort
    in C
    Oh, I see what you mean now, thank you very much
    See more | Go to post

    Leave a comment:


  • Sarahger9
    replied to merge sort
    in C
    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?
    See more | Go to post

    Leave a comment:


  • Sarahger9
    started a topic merge sort
    in C

    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...
    See more | Go to post

  • Sarahger9
    started a topic problem with classes
    in C

    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());
    ...
    See more | Go to post

  • Sarahger9
    replied to create a vector of a class
    in C
    Thanks for your help. What is MyObject, that is what I am trying to put into the vector, correct?
    See more | Go to post

    Leave a comment:


  • Sarahger9
    replied to create a vector of a class
    in C
    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);
    ...
    See more | Go to post

    Leave a comment:


  • Sarahger9
    started a topic create a vector of a class
    in C

    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:...
    See more | Go to post

  • Sarahger9
    started a topic reading and outputting a return
    in C

    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'){...
    See more | Go to post

  • Sarahger9
    started a topic Remark if word not found in text
    in C

    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...
    See more | Go to post
    Last edited by Ganon11; Oct 14 '07, 11:57 PM. Reason: Please use the [CODE] tags provided.

  • Sarahger9
    replied to outputting text character by character
    in C
    You're right, I can't believe I didn't think of that, it works, thank you very much.
    See more | Go to post

    Leave a comment:


  • Sarahger9
    started a topic outputting text character by character
    in C

    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...
    See more | Go to post

  • Sarahger9
    replied to Search files for word replacement
    in C
    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...
    See more | Go to post

    Leave a comment:


  • Sarahger9
    started a topic Search files for word replacement
    in C

    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
    See more | Go to post
No activity results to display
Show More
Working...