Answered step by step
Verified Expert Solution
Link Copied!

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
Re-write the Formula class in C++, the type definition of Formula is the same as in P1
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: e.g. 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

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 Systems A Practical Approach To Design Implementation And Management

Authors: THOMAS CONNOLLY

6th Edition

9353438918, 978-9353438913

More Books

Students also viewed these Databases questions

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago