Question: Use the following specification to code a complete C++ module named Furniture : enum class FurnitureType { Desk, Chair, Bed, None }; Basic Details Your

Use the following specification to code a complete C++ module namedFurniture:

enum class FurnitureType { Desk, Chair, Bed, None }; 

Basic Details

YourFurnitureclass includes at least the following data members:

  • the address of a C-style null-terminated string of client-specified length that holds a description of theFurniture.
  • theFurnitureType(use one of the enumeration constants defined above, defaulting toNone).

Public Member Functions

  • Default constructor
  • A custom constructor that receives in its parameters theFurnitureType(optional) and the address of a C-style null-terminated string containing the description. This function stores the data received in the current object's instance variables. If the client has omitted theFurnitureTypeargument, this function assumes that theFurnitureTypeis aBed.
  • A query namedinspectthat receives in its sole parameter the address of a C++ string (optional) containing an inspector's remark. This function returns a normalized message in the form of a C++ string. If the current object's description is not empty and the remark is not empty, the normalized message is a concatenation of the remark to the description enclosed within braces ({ })) and separated from the remark by a single space. Otherwise, the normalized message isrejected. In the case of aBedthe normalized message should not include any leading blanks, but in all other cases should include any leading blanks that are present.
  • A class function namednoItemsthat returns the number ofFurnitureobjects that currently exist and have not yet been destroyed.

Other Features

Include in your designall special member functionsrequired to manage your objects.

You are allowed to add as manyprivatemembers as you see fit.

Your design should not generate any memory leaks, should meet the C++17 standard and should apply best practices.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!