472,353 Members | 1,431 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

Dont really understand Aggregation exercise..

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/.../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
Jul 22 '05 #1
10 1686
Simon Mansfield wrote:
I have been given a list of exercises to do by my tutor, one of which is
[...]
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!


Have you asked your tutor for some clarification?
Jul 22 '05 #2
Simon Mansfield wrote:
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/.../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!


Well, it looks pretty straightforward. Try looking up "aggregation"
in your textbook. Ponder on the problem -- start with a Card, then
think of a Deck, this should get you moving.

The only thing that I don't comprehend is how a full deck of
cards can have "all the 56 cards".

- J.
Jul 22 '05 #3
On Tue, 14 Dec 2004 23:00:53 -0000 in comp.lang.c++, "Simon
Mansfield" <gl************@ntlworld.com> wrote,
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/.../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!


1. The more specific you are about what part you _do_ understand
and what your questions are, the better the help you will get.

2. I think it's a bad idea to teach methods first that would not be
the first choice of a real C++ programmer in real life. So, before
creating your own dynamically manipulated array, you should be
familiar with std::vector and use it always unless it is unsuitable
for some reason. Likewise use std::random_shuffle for all your
shuffling unless it is unsuitable for some reason.

3. What to do: write some code. Don't try to do everything at
once, but compile and test after each step. If your code doesn't
work, remember to post relevant excerpts of it here when asking
questions. This issue is covered in Marshall Cline's C++ FAQ. It
is always good to check the FAQ before posting. You can get the FAQ
at: http://www.parashift.com/c++-faq-lite/

4. Your instructor apparently has a tic about the word
"aggregation". You should probably just politely ignore that and
use classes that contain other classes in the ordinary manner.

Jul 22 '05 #4
"Victor Bazarov" <v.********@comAcast.net> wrote in message
news:Zt****************@newsread1.dllstx09.us.to.v erio.net...
Simon Mansfield wrote:
I have been given a list of exercises to do by my tutor, one of which is
[...]
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!


Have you asked your tutor for some clarification?


Yes but I ddin't really understand half the words that came out his mouth..
let alone what he was on about...
Jul 22 '05 #5
"Simon Mansfield" <gl************@ntlworld.com> wrote in message
news:41**********************@news.zen.co.uk...
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/...C++/Exercises/
Exercise%208/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!


It looks reasonably clear to me, although I don't agree with the alternative
of creating cards dynamically (you can have a dynamic collection such as a
vector or a list without having to use pointers to the actual cards; it's an
unnecessary complication).

It's not enough to say that you don't understand what is required. Are you
saying that you don't understand a word of it? Can you at least do the card
class? Do as much of it as you can, post your code, and then ask _specific_
questions about what you need help with.

DW
Jul 22 '05 #6
On Wed, 15 Dec 2004 00:28:50 +0100 in comp.lang.c++, Jacek Dziedzic
<ja*************@janowo.net> wrote,
The only thing that I don't comprehend is how a full deck of
cards can have "all the 56 cards".


14*4. Counting only the minor arcana, of course.
http://www.google.com/search?q=minor+arcana

Jul 22 '05 #7
Simon Mansfield wrote:
"Victor Bazarov" <v.********@comAcast.net> wrote in message
news:Zt****************@newsread1.dllstx09.us.to.v erio.net...
Simon Mansfield wrote:
I have been given a list of exercises to do by my tutor, one of which is
[...]
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!


Have you asked your tutor for some clarification?

Yes but I ddin't really understand half the words that came out his mouth..
let alone what he was on about...


Did he know that you didn't understand half the words? Why are we having
this conversation? Your tutor is probably paid, in that case why should
we do his job? Or he's not paid (in that case you should find another
tutor for one-on-one interaction). How can we help, off-line like this?
What do you expect from the newsgroup? If you don't understand the task,
how can we help you understand? You need to sit down with somebody to
talk about the exercise and what _exactly_ you don't understand there.
A newsgroup is too slow for that kind of interaction.

So, as was alluded by other posters, try to concentrate on the part that
you _do_ understand. Do as much as you can, then ask specific questions.

What is required? To write a program. How to do it? By using what you
already know. There are even specific steps: "Define a class", "Write
test code", "Create a Deck class", "Implement such and such method"...
What's there not to understand? If you don't understand how to "define
a class", go back to your textbook...

V
Jul 22 '05 #8
"Simon Mansfield" wrote:
Have you asked your tutor for some clarification?


Yes but I ddin't really understand half the words that came out his
mouth.. let alone what he was on about...


Try using Wikipedia to reduce the jargon to ordinary English. Unfortunately
it doesn't have "stub function", which I thought might be a problem. A stub
function is one with an empty body, e.g.:

int foo(double x)
{
}

You can compile it and call it, but nothing happens when you do.

I thought the question was phrased about as well as could be expected,
except for the 56, which has already been mentioned. Just dig in and start
writing, when you get hung up ask a specific question.
Jul 22 '05 #9
David Harmon wrote:
On Wed, 15 Dec 2004 00:28:50 +0100 in comp.lang.c++, Jacek Dziedzic
<ja*************@janowo.net> wrote,
The only thing that I don't comprehend is how a full deck of
cards can have "all the 56 cards".

14*4. Counting only the minor arcana, of course.
http://www.google.com/search?q=minor+arcana


Thank you,
- J.

Jul 22 '05 #10
On Tue, 14 Dec 2004 23:00:53 -0000, "Simon Mansfield"
<gl************@ntlworld.com> wrote:
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/.../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
--

The ultimate truth is that there is no Ultimate Truth
Jul 22 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Merlin | last post by:
Hi Imagine the following classes (A class diagram will help) BASE, A, B, C, D, E, F, G. A, B, C, D, G inherit from BASE. E, F inherit...
1
by: Nice Chap | last post by:
Aggregation in COM was defined as 'Exposing an interface of an inner object by the outer object as though it were an interface of the outer object'....
4
by: cmrchs | last post by:
Hi, how do I implement aggregation and how composition in C# ? When I say : an Airplane has a Pilot then I use aggregation but when I say : an...
2
by: Jozsef Bekes | last post by:
Hi, I would like to implement aggregation in C#, therefore I'd need to implement the queryinterface COM function of a class. I am not sure...
23
by: SenthilVel | last post by:
Hi Can any one let me know the websites/Pdf for learning Aggragation in C#?? Thanks Senthil
7
by: Bruce One | last post by:
In C#, how would people implement a relationship between Customer class and Request class, considering a customer may have 0-n requests and a...
5
by: isetea | last post by:
Hi, I'm working on a access database to automate our Staff procedures a bit. One part is to select several informations from a table and to...
0
by: Karigar | last post by:
I have been so far developing COM servers and clients in C++. I am new to C#/NET way of doing COM and was wondering if it is possible to accomplish...
2
by: Gary Wessle | last post by:
Hi what is the difference "in code writing" between aggregation and composition? is the following correct? aggregation (life time of both...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.