Thread: i dont know what to do. pls. help!!!!

  1. #1
    Unregistered
    Guest

    Post i dont know what to do. pls. help!!!!

    pls. help pls.

    Given the fruit class declaration as follows.
    class fruit { public:
    char fruit_ name[20];
    int *qty;
    }

    i. Implement constructor for fruit class that takes in fruit_name of dynamic
    character array type, which holds a string "default" and a parameter s of integer type, which contains 0, for appropriate initializing the members of type Fruit. Use operator new for member variable qty.

    ii.To create a class called fruitstall that provides a wide range of fruits, and fruitstall class contains as follows.

    ˇ three private member variables,
    a) a fruit type variable pointer called basket
    b) an integers current showing number of fruit types
    c) an integer size for all array with size objects.

    ˇ Implement a constructor that takes in s of integer type for basket data member to hold s objects of fruit type and the current is initialized to 0. Other data member is properly initialized, too.

    iii.Include a member function AddFruit for fruitstall class that takes in an object F of fruit type. The AddFruit method includes the object F into the basket if space is available; otherwise return 0 for saying tile basket is full. If the object F is successfully placed into the basket, it returns 1. The method should update the data member range.

    iv. Create an instance of fruitstall type called stall, which has a size of 10 different fruits.


    i dont know how.
    pls help
    tnx

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    You can find class declarations like this in any book and even on the tutorials of this web site. This looks like a homework assignment, and to be perfectly frank, if you don't understand the material then you should ask your teacher for clarification instead of waiting until you get so far in over your head that you can't recover. There's nothing terribly cryptic or difficult about those requirements.

    -Prelude
    My best code is written with the delete key.

  3. #3
    Registered User
    Join Date
    Feb 2002
    Posts
    589
    No one here will write the code for you. If you get stuck on the way we will be happy to help you out but for us to do your homework would not be to do you a favor.

  4. #4
    Unregistered
    Guest
    its not my homework. Its my sisters' homework.
    her teacher practically didnt explain that particular subject matter or whatever its called, and is kinda rough on students. please save my sister

  5. #5
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    If the teacher is that bad, all the students will fail and they'll get the sack. Tell your 'sister' to have an attempt at the problem and then get you to post it, and feedback will be given.

  6. #6
    Unregistered
    Guest

    Unhappy

    shes lost. dont know how to start

  7. #7
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    >shes lost. dont know how to start

    Not good enough. Does 'she' know how to -

    Implement constructor for fruit class

  8. #8
    Unregistered
    Guest

    Unhappy

    she knows just simple programs like
    "hello" ouputs

  9. #9
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    Attention to all....

    The purpose of these board is not for other to do your homework for you! Try things out work on your own, homework has a purpose. If you still have trouble with a specific thing or whatever please feel free to ask. But please DO NOT ask people to do your entire homework for you, it simply annoys people most of the time.
    Tell your 'sister' she should get herself in front of a computer pretty quick, because 'she' won't learn it if you do it for 'her'.

    If your teacher is that bad, talk to him/her. Talk to the others in your class. They will have no clue either. If your teacher is that bad, you are cheating your classmates. They will fail, but your teacher will see your good work and think he did a good job.

    i dont know how.
    Try. Give it a try as far as you get. Then come back and ask specific questions. If nothing is as far as you get, better skip programming. You should be able to produce a program with the information given, just the basic skeleton without even trying to solve the questions.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  10. #10
    Unregistered
    Guest

    Red face

    oooooohhhhh! shocking!
    ok! thanks -agy

  11. #11
    Registered User
    Join Date
    Feb 2002
    Posts
    589
    Ok this smells fishy and when I am thinking about it it scares me. 75% of the questions we get on this board is from people that are to lazy,spolied or stupid to do any work on them self. Instead you cry about bad teachers or thight deadlines. Do you think that things will get handed to you for the rest of your life? Do you think your future collegs (sp) gone do your job to? "I don't know" will not be an acceptable answear when you start to work. If you don't know it you need to get your ass out of the chair and figure it out, not ask someone else to bail you out. A teacher will not go from printf to classes over one nigh. If you can't make it through school without having other people do your homework you are not gona make it as a programmer period. SO either drop out of school or get your crap together and stop crying about your teacher.

  12. #12
    Unregistered
    Guest

    Angry

    u angry?

  13. #13
    Registered User
    Join Date
    Feb 2002
    Posts
    589
    No not really..I have a good job, nice house,,nice wife cool dogs, I know about classes and C++..Nah I am happy

  14. #14
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,823
    > u angry?

    Frustrated, more like it.... This really isn't a difficult question at all. Don't think we're saying that because we know C++.... We're saying that because any decent C++ book will have the answer after a search of about 5 seconds.

  15. #15
    Unregistered
    Guest

    Angry

    071
    114
    117
    109
    112
    121
    033

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Basic port scanner code .. pls help ???
    By intruder in forum C Programming
    Replies: 18
    Last Post: 03-13-2003, 08:47 AM
  2. help me pls..... :(
    By mocha_frap024 in forum C++ Programming
    Replies: 2
    Last Post: 02-22-2002, 10:46 AM
  3. C programming - pls pls help me
    By sally arnold in forum C Programming
    Replies: 10
    Last Post: 01-16-2002, 04:55 AM
  4. pls help me!!
    By hanseler in forum C++ Programming
    Replies: 1
    Last Post: 12-05-2001, 08:46 PM
  5. Pls Help Me In This Question!!!
    By Joanna in forum Windows Programming
    Replies: 1
    Last Post: 10-20-2001, 02:05 PM