Search results

  1. A

    Comp Sci C++ Character Processing Algorithm

    Yo, Lewando! Thanks for your all of your help. I figured out my issue. I wasn't using an ACSII character conversion formula (ch-'0'). It is working properly now. Here is the final code in case anyone is curious (I need to tidy the style up a bit): /* Character Filtration Algorithm */...
  2. A

    Comp Sci C++ Character Processing Algorithm

    Lewando, that solution makes perfect sense, however, I am required to use my teacher's algorithm. The while((ch !='\n') and data) is his piece of code and I am not allowed to change any of the test conditions. I reread the chapter on loops and nested if-else statements but I guess I am still...
  3. A

    Comp Sci C++ Character Processing Algorithm

    Hey Mark! The "not" is a boolean value for "!". Another way to write it would have been !data. However, most of this code is straight from my teacher's algorithm that are strictly required to adhere to. If I was allowed to write my own code, I would be done by now. However, I scrapped the...
  4. A

    Comp Sci C++ Character Processing Algorithm

    So, I came back to it a few minutes ago after taking a break to work on other things and now I am simply getting an output of this: The Sum is: 0 The Sum is: 0 So, as I have it written now, it's simply printing the sum's initial value, twice. I thought I understood these loops pretty well...
  5. A

    Comp Sci C++ Character Processing Algorithm

    I see a couple of problems now. Going to rewrite some things and let you know if I run into another issue or if I am able to resolve it on my own.
  6. A

    Comp Sci C++ Character Processing Algorithm

    Great question. Gave me a few ideas. 1) First idea, removed the '@' leaving a leading 2. This didn't change anything that I could tell. 2) I saved my original input file as a copy. The new "numbers.txt" contained only numbers. The program ran successfully (gave me my cout statement) but...
  7. A

    Comp Sci C++ Character Processing Algorithm

    Thanks for your reply and assistance. Well, I have tried various methods and received different outputs each time. This current code doesn't produce any output (but the codes that produced an output either didn't use sum, or the sum seems to include the characters acsii values and doesn't do...
  8. A

    Comp Sci C++ Character Processing Algorithm

    Homework Statement Hey guys! Thanks for taking the time to help me out, I really appreciate it. I am in my second semester of college, taking my first C++ course, and I had never programmed before this class so I am kind of stuck on a problem. I have almost the entire assignment figured out...
Top