Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part I: Class Design Re - write the Formula class in C + + , the type definition of Formula is the same as in
Part I: Class Design
Rewrite the Formula class in C the type definition of Formula is the same as in P
Files must be named formula.h and formula.cpp
Write a second class, Plan, that represents a sequence of Formulas to be applied in order.
Files must be named plan.h and plan.cpp
A Plan should allow the client to:
Add a new Formula to the end of the sequence.
Remove the last Formula from the end of the sequence.
Replace a Formula anywhere in the sequence.
Use dependency injection to provide an initial sequence of Formulas. The Plan class must
properly implement C copy and move semantics. The Plan copy constructor and copy
assignment operator should support deep copying of all internal Formulas so that no
unintended aliasing occurs: eg after copying Plan object x any actions on object x such
as leveling up a Formula, should not affect any copy of x
The Plan class must implement a destructor to appropriately dispose of owned resources.
Each Plan object encapsulates some number of distinct Formula objects, with addition, removal
and replacement of Formula objects supported as specified above thus the cardinality of Formula
subobjects varies across Plan objects. You decide what, if any, additional public functionality
should be supported., remembering that exposure should be minimized and queries should not
affect state.
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