Object oriented programming, Programming Languages

I need help with this question. The problem i''m having is that what''s the syntax for using dynamic memory allocation of objects of one class in the constructor of some other class. in short, how can i use dynamic memory allocation of objects inside composition?


SEECS is organizing student fair where students will be setting up food and game stalls.
Everybody is invited faculty, students, staff and even the families. To make the customers buy
more food and try more games the student administration devised an interesting plan. They are
arranging lottery scheme at every stall. But as always happens there is a problem, the
management of such a big scheme. To handle this problem the student administration has
hired you to make an application to manage the records of the lottery.
Firstly, the plan of the student administration is that every stall has its own lottery.
Every time when a customer will buy any food item or try any game form any stall a new entry
in the lottery of respective stall will be automatically made by the application. The
administration has also decided to monitor the whole system by themselves, that’s why the
lottery system of stalls will be running from the same server. At the end a random function will
chose the winner and announce that.
Your application would be having a structure like this:
- A class fairwhich has capacity of up to 5 stalls (the main server).
- A class stallwhich has its own necessary specifications like name, type, Id,
owner etc. in addition to a single instance of lottery.
- A class lottery to hold up to 100 customers irrespective of the type i.e.
faculty, student, staff or family
- A classcustomer to hold the basic information like name, type, time_of_entry
etc. and lottery Id number of the customer.
The Application must be having at least the following functionalities:
- Providing an interface to enter the data of new customer every time he buys
any food item or plays a game.
- Assigning an Id to each customer by itself after the data has been entered.
- At the end choosing a winner form each stall by some random function.
Notes:
- Use composition.
- Make necessary functions, constructors and destructors.
- Use dynamic memory allocation where ever possible (Bonus points).
- You must apply all the necessary checks.
- Not just the correct, User friendly and easy to use interface will get maximum marks.
Hint:
- Think of the real world scenario and make the things accordingly.
Posted Date: 4/8/2012 10:49:34 AM | Location : United States







Related Discussions:- Object oriented programming, Assignment Help, Ask Question on Object oriented programming, Get Answer, Expert's Help, Object oriented programming Discussions

Write discussion on Object oriented programming
Your posts are moderated
Related Questions
SailDublin Ferry provides ferries to mainland Britain, Europe and America. Having observed the success of Irish ferries and Stennaline online booking system; SailDublin ferry has d

Write a function named prob2.m which creates and returns an N×N identity matrix. An identity matrix is a square matrix with values of one on the main diagonal and zeros in all off-

Attributes to Elements Create an XSLT stylesheet that converts all attributes found in a given XML document to elements.Use the sample instance from question 2 to test the tra

How to make game in pascal language

Question 1 How to call a WML Script from a WML Page? Question 2 Write short notes on WML Script Operators and Expressions Question 3 Write short notes on WML Script Statements

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

Write a function that converts a character array to a signed floating point number. Function prototype must be as follows: int asciiToFloat( char *str, unsigned char* eflag) Follow

Im having problems with my php / mysql code. I am trying to make it so it looks for an asset Number and if it is in the shop if the asset is in the database but is not in the shop

The idea of this section is not to do anything new along with a series solution problem.  Instead this is here to exemplify that moving in a higher order differential equation does

Expertsmind brings you unique solution in java assignments Swing Move is the primary Java GUI gadget tool set. It is part of Oracle's Java Groundwork Sessions (JFC) - an A