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
LALR Parser: Rule Table - Contains definitions of production rules within the grammar. Attributes: Count - Number of production rules in the table Child items:

Select two different architecture styles to design and implement a software system and provide its Architecture Diagrams (implement the software with java)

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

Write a program that accepts a date from the user in the form mm/dd/yyyy and then displays it in the form month dd, yyyy, where month is the name of the month. Enter a date (mm/d

Write your own version of the strcmp function string_compare. Supply a main program that will test each of the 3 differing outcomes. int string_compare(char *s, char *t); retu

1)      Go to Start -> Programs->Accessories->Notepad. 2)      Start with a document type tag & an opening tag. Enter the given line in your doc.

You will design and implement a program that will • analyse the various characteristics of a maze, represented by a particular coding of its basic con- stituents into numbers store

Selfcare Project:   Technology Used Strut Frame work, WAS 5.1, WPS 6.0, DB2, AJAX, Eclipse, Rational Application Developer 6 and  DB2 Selfcare is a big umbrella under whic

Draw the sequence diagram for the following scenario of eBroker. Sell Stock The user enters the username and password The system checks that the user is a valid user

(a) Define a procedure (subsets x) that takes a list as a single argument and returns all 2^n subsets of that list, i.e. the power set of the list; e.g. (subsets '(a b c)) ==> (