April 6th, 2013, 05:49 AM
Little Help with a program.
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.
April 6th, 2013, 05:55 AM
Re: Little Help with a program.
Have you some ideas how you would perform this work on the paper?
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!
If not - then it doesn't make any sense to discuss about coding.
April 6th, 2013, 07:18 AM
Re: Little Help with a program.
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
I have no idea what to do whatsoever
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 the effects of your programs and the integrity of the machines they run on. This post is public domain as specified at https://creativecommons.org/publicdomain/zero/1.0/
C, C++ Compiler: Microsoft VS2017
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!