Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

manipulates a set of Movies. There are two types of Movies in our system: Sci _ Fi Movies and Action Movies. Consider the following UML

manipulates a set of Movies. There are two types of Movies in our system: Sci_Fi Movies and Action Movies. Consider the following UML class diagram. The Movie class is
5. The size of the castMemebrs_ array is stored in castMemebrsSize_
6. Each movie has one releaseDate_() of type Date.
7. locationDays_ is an array of integers that stores the number of days for every shoot location. For example, if the first location in the ShootLocations_array was used for 10 days, the first entry in the locationDays is 10, and so on.
8. The size of locationDays equals the size of shootLocations, which is stored in shootLocationsSize.
9. Write the default constructor to initialize the data members with proper default values.
10. Write setters for all data members.
11. Write getters for all data members.
12. Write a parameterized constructor that receives value for all data members as follows.
Movie(string name, float rate, Date d, CastMember* CS, ShootLocation* SL, int* LD, int castsize, int locationsize)
13. The calculateBudget has no implementation in the movie class, yet it has a different implementation in Sci_fi, and Action classes. The calculateBudget is a pure virtual function that has no implementation in the movie class.
14. printDetails is a virtual function that prints all the information of the movie. It should call the printDetails function from the classes ShootLocation, Date, and CastMember
Question 3: Implement the Sci Fi class.
Class Sci_Fi
a- Do not separate the header from the implementation; write all the code in Sci Fi.cpp.
b- The Sci_Fi class inherits from the Movie class.
c- The Sci_Fi class contains three data members: fromAbook (bool), brief_(string), additionalCost_(int).
a- The calculateBudget() should return the total budget which equals the additional cost plus the original cost. The additional cost is stored in the additionalCosts_data member.
The original cost equals the sum of the cost of all shoot locations.
The cost for each shoot location can be calculated by multiplying the
LocationCostPerday_() in the ShootLocation Class by the number of days which is stored in the LocationsDays_array.
b- Define a void function called shuffle, the function receives an array of Action pointers with its size. The function should apply the following for each pointer.
Shuffle the castMemebrs_array, which means to change the order of the elements in the array randomly.
Shuffle the shootLocations_array and
LocationsDays_array, which means to change the order of the elements in the arrays randomly, make sure that the data is still consistent. For example, if the shootLocation that was at index 0 before the shuffling, become at index 4 after shuffling then the locationDays_element that was at index 0 before the shuffling should also become at index 4 after shuffling.
Question 5:
main
Create an array of two Movie pointers.
The first pointer should point to an Action movie object (you can make it in the stack or in the heap). The information in the object is from your choice.
The second pointer should point to a Sci_Fi movie object (you can make it in the stack or in the heap). The information in the object is from your choice.
Action(int numOfHeros, string name, float rate, Date d,
CastMember* CS, ShootLocation* SL, int* LD, int castsize, int
locationsize)
NOTE: (Using C++ language).
image text in transcribed

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 Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions

Question

1. Let a, b R, a Answered: 1 week ago

Answered: 1 week ago

Question

LO2 Describe the various purposes of performance appraisals.

Answered: 1 week ago