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
Oracle 11G Reports We are troubleshooting the pagination of Oracle reports when printed from a browser. We need help determining the issue and correcting within the report ou

Create a visualization (programming project) and demonstrate it in the class. The project should be related to distributed systems. (A distributed system consists of multiple auton

Question 1 Discuss on UNIX kernel components 2 Explain process creation and process termination 3 When do a Deadlock occur? What are the Necessary Conditions for Deadlock

Problem 6. Demonstrate how and when can you use the commands- vi, cat, chmod, grep, man, pwd, ps, kill, mkdir, rm demonstrating how and when the above 10 commands can be

Companies divide their subtasks of game's development. For large complex games, the development team can vary in size from 20 to 100 or more members. The most represented are artis

1.   You have been asked to write a computer program that will figure out the total of an order when given the amount of the order ($200) and a sales tax rate of five percent.  I w

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

Modularity, Abstraction, and Modelling Whether proving a theorem by creating up from lemmas to simple basic theorems to more accurate results, or designing a circuit by creati

Use list recursion to de ne the function mySum which takes as input an integer and a list of integers and returns the list obtained by adding every element of the list by the rst

write and compile a simple program in Assembly Language that compute and print student grades for a course.which you can open a file, read from it, and compute the results...using