pty string value, it will create a Variable object, otherwise it will create a VariableString object. It will return the pointer of
in C++
Write a function named “createVariableObject” that will read in the variable name, description and
a value (string) from the user and create a dynamic Variable or VariableString depending on the value: if the user provides an empty string value, it will create a Variable object, otherwise it will create a VariableString object. It will return the pointer of the newly created object.
This function must handle all error cases for invalid variable names entered by the
user: starting with a non-alphabet letter or containing blanks by handling exception using
try-catch. It will print out proper error message and continue to ask the user for
the new value until it is correct name.
Please show how this function is being tested and
print out the correct variable information.

Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images









