Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ Question 1: Use the class Novel to complete the following task. Implement Event class for selling novels as follows: 1. The member variables: -

c++
image text in transcribed
image text in transcribed
Question 1: Use the class Novel to complete the following task. Implement Event class for selling novels as follows: 1. The member variables: - event id: int. - event location: string. - number of novels: int. It is unknown and can vary from one event to another. - novels: Novel array, its size is the number of novels. 2. An Event class constructor that receives: event number and location. You have to use this pointer. 3. A member function void SetNovels( novels * n, int num_of_novels) which sets the novels for the event according to received array of novels. Note that this function can be used to change the novels as well. 4. A Destructor for Event Class. 5. copy constructor. 6. A member function GetTotalPrice which returns the sum of all novels price in the same event. 7. A friend function removeNovelFromEvent(Event& currentEvent, int i): this function remove the ith novel from the array novels in the currentEvent object and shifts remaining Novels. i should be in a proper range. Note: you have to create new Novel array. 8. A friend function printDetails(Event& e) to print the details of the event. Question 2: write a main function consists of the following: 1. create an object of type Event called eventi. - event id: 1 - event location: Amman - number of novels: 3 - novels: fill the novels from the user 2. create an object of type novel called eventicopy, it is a copy of the object event. Use the copy constructor. 3. call the function removeNovelFromEvent to remove the first element in the novels array of eventi. 4. call the printDetails function for the two objects

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management An Organizational Perspective

Authors: Richard T. Watson

1st Edition

0471305340, 978-0471305347

More Books

Students also viewed these Databases questions

Question

Is it clear what happens if an employee violates the policy?

Answered: 1 week ago