Write code to implement constructor, assessors and mutator, C/C++ Programming

Study the following  class diagram, additional information  and answer  the  questions that follow:

MovieTicket

movieName: string

TicketPrice: double

TicketsSold: int

donation[100]: double 

totalCnt: int

MovieTicket();

getName():string

getTicketPrice():double

getnoOfTicketsSold():int

setName(string): void

setTicketPrice(double): void

setnoOfTicketsSold(int): void

computeDonation(int): void

writeFile():void

Additional Information:  

MovieTicket is a class written to fulfil the requirements of making 100 donations to charity from the ticket sales.  The donation is derived from 10% of the ticket sales. The donations are written to a file.

(a)  Write the class specification for MovieTicket.  

(b)  Write code to implement the following for MovieTicket:  

(i)  Constructor, Assessors and Mutators

(ii)  computeDonation method

(iii)  writeFile method

(c)  Write a test driver to test ALL the methods written in Part (b).  The program uses a loop  to  repeat 100 times to obtain input (movie name, tickets sold and ticket price) from user and invokes the respective methods to set the values and computes the donation. After the loop, the    contents of donation array are written to a file using the writeFile method. Include a screen output in your submission.

Posted Date: 3/23/2013 6:24:52 AM | Location : United States







Related Discussions:- Write code to implement constructor, assessors and mutator, Assignment Help, Ask Question on Write code to implement constructor, assessors and mutator, Get Answer, Expert's Help, Write code to implement constructor, assessors and mutator Discussions

Write discussion on Write code to implement constructor, assessors and mutator
Your posts are moderated
Related Questions
Help me evaluate suitable OpenCV filters to get an inital working tracking algorithm. In this case it's objects moving on water (sea) and since I have very limited OpenCV knowledge


How to Define a Structure? Structure declarations are rather more complicated than array declarations, ever since a structure must be defined in terms of its individual members

A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''a''-''z'') and the asci

Ask question #Minimum 100 write an algorithm to calculate simple interest and compound interestwords accepted#

P o i n t er s to Members: In C a pointer is created  to locate  the address of another variable  for faster access. Consider the following example. int x, *p; p =

Luminous Jewels - The Polishing Game Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various lum

solve mesh and nodal analysis through c/c++?

Program is to create a file student.dat: Program is to create a file student.dat which contains all name, roll_no,marks(5 sub) and percentage   class student    {

Step 1 Define the start of the program    It should be noted that within C all commands should end in a semi-colon. For most of your programs the definition of a program header as