CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Nov 2009
    Posts
    3

    Need help with a homework dealing with class inheretence

    This is the homework

    http://i34.tinypic.com/30bjpd0.jpg

    It's #5


    This is my code
    http://pastebin.com/d76a45c10

    This is how it runs


    Any idea what I can fix or do with that last display? I need to use that method/function to display it but it freaks out to no end when I try to do it via the method/function. I just know that there has to be something I"m missing something really stupid.

  2. #2
    Join Date
    Jul 2009
    Posts
    45

    Re: Need help with a homework dealing with class inheretence

    function1: Replace void constructor() with your default class name
    Other functions should be done similarly, and I have no idea why you construct your classes that way.

  3. #3
    Join Date
    Nov 2009
    Posts
    3

    Re: Need help with a homework dealing with class inheretence

    Quote Originally Posted by Ha555 View Post
    function1: Replace void constructor() with your default class name
    Other functions should be done similarly, and I have no idea why you construct your classes that way.
    Just because I know what's the contructor and what not... so void constructor should just be... Restuarant meal?... but that doesn't really help me currently.

  4. #4
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: Need help with a homework dealing with class inheretence

    Quote Originally Posted by rubsnick View Post
    Just because I know what's the contructor and what not... so void constructor should just be... Restuarant meal?... but that doesn't really help me currently.
    You really need to clean up the obvious mess first. Get rid of the explicit "constructor" functions and replace them with the standard versions. Regardless if you create a function named "constructor", the compiler will also generate one with the same name of the class that will be run when the object is created. That's what a constructor is, not a function you call.

  5. #5
    Join Date
    Nov 2009
    Posts
    3

    Re: Need help with a homework dealing with class inheretence

    Screw it . I solved my problem my code works. I am student and I feel that names are irrelevent to the function. I just want to get the job done I care little for prettyness the important thing is I learn and i frankly dont see the problem with a simple name. I could name it butthead and it will do the same **** function! thanks but no thanks i managed to solve my problem my self. ya wont be seeing me here again. you elitist bastards

  6. #6
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: Need help with a homework dealing with class inheretence

    Quote Originally Posted by rubsnick View Post
    Screw it . I solved my problem my code works. I am student and I feel that names are irrelevent to the function. I just want to get the job done I care little for prettyness the important thing is I learn and i frankly dont see the problem with a simple name. I could name it butthead and it will do the same **** function! thanks but no thanks i managed to solve my problem my self. ya wont be seeing me here again. you elitist bastards
    Bye. Thanks for dropping by. Glad to see you know it all already. Good luck with that attitude in the real world. You're going to need mentors and more experienced people to help you as you go and that's not how to go about getting them. That outburst would cost you your job in most places I know.

  7. #7
    Join Date
    Jun 2008
    Posts
    592

    Re: Need help with a homework dealing with class inheretence

    So they provide good "FREE" constructive criticism and you go ballistic on them? read http://en.wikipedia.org/wiki/Bipolar_disorder

    Also function names matter
    0100 0111 0110 1111 0110 0100 0010 0000 0110 1001 0111 0011 0010 0000 0110 0110 0110 1111 0111 0010
    0110 0101 0111 0110 0110 0101 0111 0010 0010 0001 0010 0001 0000 0000 0000 0000
    0000 0000 0000 0000

  8. #8
    Join Date
    Nov 2009
    Posts
    4

    Re: Need help with a homework dealing with class inheretence

    function names don't matter much to the computer, they only matter to the programmer. unless the name of the function is a reserved word, or something like that that. yes it is true. you can name them anything you want (within the rules) but it is just stupid to work that way. names that do not make sense and the lack of comments is the mark of a newb, or a lazy student who doesn't care about anything but a grade. The things experienced people teach us can help us avoid making the mistakes they made if we will just listen.

  9. #9
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Need help with a homework dealing with class inheretence

    Quote Originally Posted by GCDEF View Post
    Bye. Thanks for dropping by. Glad to see you know it all already. Good luck with that attitude in the real world.
    I bet rubsnick will come crawling back here (under another name of course), asking for one of us to help him/her with another assignment.

    Regards,

    Paul McKenzie

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

Featured