Results 1 to 9 of 9

Thread: I'm bored

  1. #1

    Thread Starter
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    I'm bored

    What would be a useful class to make in C++?

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    One with hot, scantily clad chicks in it.

  3. #3

    Thread Starter
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    Originally posted by mendhak
    One with hot, scantily clad chicks in it.
    oOoOoOo

    Pixelated ones?

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    yeah, and a teacher with a whip.

  5. #5

    Thread Starter
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    But seriously, I'm bored and I want to write something useful

  6. #6

    Thread Starter
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    You people suck at teh suggestions

  7. #7
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Write a class that will wash my car.

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  8. #8
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Write a class that overloads the operators to perform string operations, in addition to a new binary operator which can convert any text or numeric string into binary code.

    ALSO:

    Consider the following definition of a C++ class that acts like an array with bounds-checking (i.e. ensuring that a valid array index is used each time an array element is referenced).
    class checked_array {
    public:
    checked_array(int s): size(s) { a = new int[size]; }
    int &operator[](int i);
    int get_size() { return size; }
    private:
    int size;
    int *a;
    };

    Complete the definition of the checked_array class by defining its operator[] method, but placing the definition outside of the class. Be sure that operator[] checks that the index is between 0 and size - 1.

    Convert the checked_array class to a class template, where the type of the elements of the array is a template parameter.

    Declare a class template called comparable_checked_array, derived from checked_array, which implements the < operator for comparing two comparable_checked_array's. Given comparable_checked_array's X and Y, X < Y if the sum of the elements of X is less than the sum of the elements of Y


    Finally, create a checked_array A containing elements that are themselves comparable_checked_array's of integers. Then, use your sort template to,
    for each element x of A, sort the elements of x, and
    sort A itself.

    For example, if A is a checked_array of comparable_checked_array's such that:

    A[0] = {2,4,1}
    A[1] = {5,3,7}
    A[2] = {0,3,2}


    then after all the sorting, A will look like:

    A[0] = {0,2,3}
    A[1] = {1,2,4}
    A[2] = {3,5,7}



    What to turn in:

    Turn in a single C++ source file with:
    The complete definition of the checked_array class template,
    the definition of the comparable_checked_array class template,
    the template function sort(), and
    the main() procedure which creates the array A described above and calls the necessary procedures for sorting each individual element of A as well as sorting A overall. Your program should print out A before and after sorting.


  9. #9
    Addicted Member Para80d's Avatar
    Join Date
    Oct 2003
    Location
    Denton, TX
    Posts
    160
    HAHAHAHAHAHAHA

    that's all i got.

    Good suggestion by the way
    C++/VB6&.NET/QBasic/HTML/PHP/MySQL/SQLServer2k

    I'm the guy your little brother looks a lot alike. Tell your mom i said thanks.

    naked in vegas

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width