Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use modern libraries BUT ONLY when permitted a . May NOT use generic vector, stack, queue, etc., unless explicitly noted b . Cost of built

Use modern libraries BUT ONLY when permitted
a. May NOT use generic vector, stack, queue, etc., unless explicitly noted
b. Cost of built-in containers often unwarranted => use raw arrays
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.Use modern libraries BUT ONLY when permitted
a. May NOT use generic vector, stack, queue, etc., unless explicitly noted
b. Cost of built-in containers often unwarranted => use raw arraysPart I: Class Design

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

Advanced Database Systems

Authors: Carlo Zaniolo, Stefano Ceri, Christos Faloutsos, Richard T. Snodgrass, V.S. Subrahmanian, Roberto Zicari

1st Edition

155860443X, 978-1558604438

More Books

Students also viewed these Databases questions