Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This needs to be done in C++ Here is the code provided: //Frame.h #pragma once class Frame { char* frameName; double duration; public: Frame(char*, double);
This needs to be done in C++ Here is the code provided:
//Frame.h #pragma once class Frame { char* frameName; double duration; public: Frame(char*, double); Frame(const Frame&); ~Frame(); Frame& operator=(const Frame&); friend ostream& operator frames; public: Animation(string name):animationName(name) {} ~Animation() {} void EditFrame(); void DeleteFrame(); friend istream& operator>>(istream&,Animation&);// Add a Frame as in cin >> A; friend ostream& operator animations; public: AnimationManager(string name) :managerName(name) {} ~AnimationManager() {} void EditAnimation(); void DeleteAnimation(); friend istream& operator>>(istream&, AnimationManager&);// add an Animation friend ostream& operator #include#include #include #include using namespace std; #include "Frame.h" #include "Animation.h" #include "AnimationManager.h" int main(void) { char response; bool RUNNING = true; AnimationManager M("Manager1"); _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); while (RUNNING) { cout>response; switch (response) { case '1':cin >> M; break; case '2':M.DeleteAnimation(); break; case '3':M.EditAnimation(); break; case '4':cout Purpose: This is a development of assignment 1 with the addition of a two ready-made container class templates and overloaded operators. It works in a very similar way. It is a console application that has an AnimationManager that holds a vector template of Animation objects each of which holds a forward_list template of Frames. In addition the string class is used to hold some of the strings in the application. A string is essentially a vector of chars Part of the code is shown on the next page; it is also on Brightspace in a text file that you can copy and paste. BecauseI will use this code when I test your submission, you MUST use this code without modification (not a single character changed): no code added or removed, no new global variables or functions, no new classes, no macros, no defines and no statics. Your task is to implement, using C++, only the AnimationManager, Animation and Frame class member functions and the global insertion operators and not add any new ones. Everything you write and submit is in the files AnimationManager.cpp, Animation.cpp and Frame.cpp When the application runs you can Add a new Animation to the AnimationManager at the back of the vector Delete a particular Animation Edit a particular Animation to maintain its forward_list of Frames List the AnimationManager to show all its Animations and their Frames Quit An example of the output of the running application is given at the end. Yours must work identically and produce identical output. Note the following dynamic memory management is done with new and delete there is no unused dynamic memory at any time input/output is done with cin and cout string objects are used in the AnimationManager and Animation classes to hold names but a c- style NULL-terminated char array is still used in the Frame class Release of objects' dynamically allocated memory is done in destructors so there is no resource leak (or you lose 30%)-destructors are never explicitly called do not # include header files at the top of supplied header files (AnimationManager.h, etc) . Purpose: This is a development of assignment 1 with the addition of a two ready-made container class templates and overloaded operators. It works in a very similar way. It is a console application that has an AnimationManager that holds a vector template of Animation objects each of which holds a forward_list template of Frames. In addition the string class is used to hold some of the strings in the application. A string is essentially a vector of chars Part of the code is shown on the next page; it is also on Brightspace in a text file that you can copy and paste. BecauseI will use this code when I test your submission, you MUST use this code without modification (not a single character changed): no code added or removed, no new global variables or functions, no new classes, no macros, no defines and no statics. Your task is to implement, using C++, only the AnimationManager, Animation and Frame class member functions and the global insertion operators and not add any new ones. Everything you write and submit is in the files AnimationManager.cpp, Animation.cpp and Frame.cpp When the application runs you can Add a new Animation to the AnimationManager at the back of the vector Delete a particular Animation Edit a particular Animation to maintain its forward_list of Frames List the AnimationManager to show all its Animations and their Frames Quit An example of the output of the running application is given at the end. Yours must work identically and produce identical output. Note the following dynamic memory management is done with new and delete there is no unused dynamic memory at any time input/output is done with cin and cout string objects are used in the AnimationManager and Animation classes to hold names but a c- style NULL-terminated char array is still used in the Frame class Release of objects' dynamically allocated memory is done in destructors so there is no resource leak (or you lose 30%)-destructors are never explicitly called do not # include header files at the top of supplied header files (AnimationManager.h, etc)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started