Question
1) write a constructor function (not inline) for Square objects. It should take a vector of string tokens as its only parameter. If there are
1) write a constructor function (not inline) for Square objects. It should take a vector of string tokens as its only parameter. If there are at least 2 tokens, the one at index 1 is the side dimension.
Do not write the prototype -- just the function as it would appear elsewhere in the CPP. When you write code for an exercise like this, write in "preformatted" instead of the default "paragraph".
2) write a constructor function (not inline) for Square objects. It should take a vector of string tokens as its only parameter. If there are at least 2 tokens, the one at index 1 is the side dimension.
But apply the principle of least privilege. The parameter should be constant, and the side dimension should be a constant data member.
Do not use const_cast . Use an initializer list. Do not write the prototype -- just the function as it would appear elsewhere in the CPP.
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