Search:

Type: Posts; User: matt_570

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    1,633

    Invalid use of class

    I have to create two classes CPU and Computer. The CPU.h and Computer.h needs to be different files than the CPU.cpp and Computer.cpp. I believe I created my files correctly however in my Computer...
  2. Replies
    5
    Views
    1,083

    I think I understand what you're implying,...

    I think I understand what you're implying, however after working on the function again today for hours I'm still having the same problem. I ended up with three different functions and none of them...
  3. Replies
    5
    Views
    1,083

    Ok thanks, I shoud have overlooked it. I have my...

    Ok thanks, I shoud have overlooked it. I have my option menu working fine, but it seems like my insertAtIndex function is not working properly. I can add one new element fine but when I try to add...
  4. Replies
    5
    Views
    1,083

    A little help with Linked List functions

    I need to create a linked list of customer data. One functions needs to insert a new customer data at the location indicated by the parameter "index". If index is 0 then it should be inserted as the...
  5. Replies
    3
    Views
    1,000

    A little help with pointers and arrays

    I have to write functions that manipulates an array containing numbers (doubles).
    I have to use pointers for all arrays to do this.

    One function prints the array, the next one triples each...
  6. Replies
    2
    Views
    1,625

    Help fixing a compile time error

    I had to define a simple macro for class in the professor's code

    Heres the code -

    #include <stdio.h> //this is to call printf() function to put output
    #include <time.h> //this is to call...
  7. Replies
    18
    Views
    5,954

    Thanks for the quick reply. I started messing...

    Thanks for the quick reply. I started messing with "outFile.put(out_file_name);" but that didnt work. Out professor told us only to read the first two chapters on "I/O File Streams and Data Files"....
  8. Replies
    18
    Views
    5,954

    I'm now trying to write my stats to a text file,...

    I'm now trying to write my stats to a text file, but its only writing two of the stats, and those stats come from the same function.

    Heres the code -




    #include <iostream>
    #include...
  9. Replies
    18
    Views
    5,954

    Thanks a lot, that helps a lot. I'm on my last...

    Thanks a lot, that helps a lot. I'm on my last stat, I have to find the most commonly occuring word(s). Heres my function-



    void commonWord(double count[], int array_length, words array[])
    {...
  10. Replies
    18
    Views
    5,954

    Ok, heres my revised code- #include...

    Ok, heres my revised code-



    #include <iostream>
    #include <fstream>
    #include <cstdlib>
    #include <string>
    #include <iomanip>
    using namespace std;
  11. Replies
    18
    Views
    5,954

    You would be better off not ever writing a...

    You would be better off not ever writing a duplicate word to your array. You can do this by reading a line and then searching your array of words for the just-read word. If found, bump the word...
  12. Replies
    18
    Views
    5,954

    I need to compare words in a text file. In the...

    I need to compare words in a text file. In the text file there is only 1 word per line. I need to store the words, count the unique words, and do some other stats. I just realized that my strcmp will...
  13. Replies
    18
    Views
    5,954

    Thanks you that worked. I'm now trying to use...

    Thanks you that worked. I'm now trying to use strncmp to find out the number of unique words (or lines) in the text file. I tried to use-



    for( j=0; j<101; j++)
    {
    n = strcmp(...
  14. Replies
    18
    Views
    5,954

    Sorry about the first post I wasnt clear with my...

    Sorry about the first post I wasnt clear with my question. I'm still having trouble on the storing part.

    I want to store a text file line by line, where theres one word per line. I tried to store...
  15. Replies
    18
    Views
    5,954

    Storing Words from a text file

    Hey I have to write a program that reads a text file that contains a list of words, 1 word per line. I have to store the unique words and count the occurrences of each unique word. When the file is...
  16. Replies
    12
    Views
    9,031

    OK I got it, thanks for the help. However this...

    OK I got it, thanks for the help. However this assignment just keeps on getting harder and harder. I have 3 more functions to complete.

    Function1:
    I have to print the positions of the three...
  17. Replies
    12
    Views
    9,031

    Ok I have this- void printArray( int...

    Ok I have this-


    void printArray( int array[], int number)
    {


    for (int j=0; j<number; j++){
    for (int i = 0; i<10; i++){
    cout<< array[j]<< ", ";
  18. Replies
    12
    Views
    9,031

    Thanks for the help. However I have a new...

    Thanks for the help. However I have a new problem. I thought this part was going to be easy but its hard.



    I've been trying all day to come up with a for loop to do it. I have a bunch of...
  19. Replies
    12
    Views
    9,031

    Random number array

    Hey I have to build a random number array, heres the exact problem-



    I'm on the first part. My code is this-


    #include <cstdlib>
    #include <ctime>
    #include <iostream>
  20. Replies
    5
    Views
    3,484

    function does not take 0 arguments

    Hey I'm trying to compile my program, but I cannot figure out this compile error, I've spent almost 2 hours now trying to figure it out.

    Heres the code :


    # include <iostream>

    using...
  21. That's what I thought at first, but D was...

    That's what I thought at first, but D was basically B + C together meaning it always had (input * 2) - 1 for the number of lines. For example if the input was 5 the number of lines would be...
  22. Thanks for the help, I was able to get shapes...

    Thanks for the help, I was able to get shapes A-D, but now I'm having trouble on E.
    Heres the code so far-


    #include <iostream>

    using namespace std;

    int main ()
    {
  23. Ok I accidentally used "i" for both variables. ...

    Ok I accidentally used "i" for both variables.

    Right now I tired to code a couple different solutions and non seemed to work. ( I tried to write algorithms yesterday and came across thinking they...
  24. wouldn't it be for (i=0; i < 5; i= i +2) I...

    wouldn't it be

    for (i=0; i < 5; i= i +2)

    I think the main part I'm having trouble with is the "endl;"


    for(i=0; i<5; i = i+2)
    cout << "+";
  25. Printing "shapes" based on character lines and number of line inputs

    Hey I enrolled in an online beginners C++ this semester. I think I made my first mistake by taking my first programming class online.
    Anyways we've had assignments in sequence and selection...
Results 1 to 25 of 25