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
WHAT IS CGI?

to count number of occurances

What are the different types of endless loops? An endless loop can be of two types: i.) A loop that is intentionally designed to go round and round until the condition withi

write a program to calculate the cuboid

Explain the different types of errors in PHP. Warnings, Notices and Fatal errors are the types of errors in PHP Notices: Notices signifies non-critical errors, i.e. ac

Two kinds of line detection are implemented in OpenCV, the Hough Transform and the probabilistic Hough transform. Assume that there are n feature points in an image and that it tak

A virtual function permits derived classes to replace the implementation given by the base class. The compiler makes sure the replacement is always known as whenever the object in

good night i have an assignment that i really need help with. i have to create a struct file with tag name book to have members int book_id char isbn[255]

Write a C program "team.c" that maintains information for a soccer team. The program will allow you to add and delete players from your team, to search your team for players by nam

progarm in c for area under curve   #include float start_point, /* GLOBAL VARIABLES */ end_point, total_area; int numtraps;