I have been given a list of exercises to do by my tutor, one of which is
this:
http://www.cems.uwe.ac.uk/~amclymer/Software Design and C++/Exercises/Exercise 8/Exercise.html
Which i am finding very difficult to understand what is required and how
exactly to do it.. Any thoughts/idea's will be greatfully recieved!
Global_Inferno
Lets have a look at the question:
"1 Define a class to represent a Card."
Do you know what a class is? Can you write one down? What don't you
understand about:
class CardC {
};
Whatever you do not understand, ask your tutor or ask here, but please
do ask specific questions otherwise you will probably get general
answers.
"The class should have at least two properties value and suit,"
Do you understand what a class' properties are? Do you know how to
add them to the class you have just written? How about:
Xxxx m_value;
Yyyy m_suit;
You will need to decide what types you want Xxxx and Yyyy to be. The
m_ prefix is sometimes used to indicate the properties (= members) of
a class. Ask specific questions about what you do not understand.
"and two methods to obtain the card suite and value"
That should be "suit", not "suite". Do you understand what a class'
methods are? Do you know how to add them to your class? I would
suggest:
Xxxx get_value() const;
Yyyy get_suit() const;
If you have done inline functions these two would be good candidates.
Now go through the rest of the problem description and list the bits
you do not understand. Ask your tutor questions and ask here. Use
the answers to put together some code and ask again, showing your
code. You should have enough now to write your card class. The more
code you show the more likely people here are to help you.
rossum