Little Help with a program.
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Little Help with a program.

  1. #1
    Join Date
    Apr 2013
    Posts
    1

    Little Help with a program.

    Hey guys,

    I am currently really new to this and I am stuck on some programs and was wondering if anyone could help me with either or both of the program specifications bellow.

    1. Construct a class diagram that can be used to represent food items. A type of food can be classified as basic or prepared. Basic food items can be further classified as meat, fruit, veg or Grain. The services provide by the class should be the ability to enter data for new food, to change data for food and to display existing data about food.

    using this class definition write a main program to include a simple menu that offers the following choices:
    1. Add food
    2. Modify Food
    3. Delete Food
    4. Exit this menu

    2. Read a list of numbers from a file and then print them out in reverse order. State whether the list is palindromic or not.

    I know some people refuse to do code for other people so if that is the case, could anyone provide even sections of code or psuedocode or something because I have no idea what to do whatsoever. Any help will be much appreciated.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,011

    Re: Little Help with a program.

    About homework:
    A special note about Homework
    We have an FAQ about homework questions. If your question is related to a homework assignment, then read this FAQ. It will help you, help yourself!
    Have you some ideas how you would perform this work on the paper?
    If not - then it doesn't make any sense to discuss about coding.
    Victor Nijegorodov

  3. #3
    Join Date
    Dec 2012
    Location
    England
    Posts
    1,999

    Re: Little Help with a program.

    I have no idea what to do whatsoever
    Why not? How have you been learning c++ up to now - course? I doubt that your first c++ program is based upon coding c++ classes! So you have some previous c++ knowledge and presumably have produced some working c++ programs before now. So you should have some ideas as Victor said in post #2

    1) So have you produced the class diagram? As you are being asked to produce one, they must have been covered by the course from which you are learning. If you don't understand what been already covered in the course then you need to go back to your course notes and/or the tutor for clarification. Once you have produced the class diagrams and had an attempt at producing the c++ classes then if you post the code here we'll help you with suggestions without doing the work for you.

    2) If you don't know what is a palindromic list/number, try an internet search. There's plenty of good info available. If I was producing a program for this, I would use a STL vector class to hold the data and then use the reverse iterator to obtain values in reverse order. Again, if you are having problems with the c++ code post the code and we'll provide suggestions.

    If you do post code, please format and indent the code properly first and use code tags (Go advanced, select code then click '#').
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

Posting Permissions

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


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center